Skip to main content

Animation

This section provides guidance for setting up custom animations on entities. These are animations that transform some element of the entity over time, such as position, scale, or a property of some component on the entity. Note: This section deals with creating animations in Studio and working with Studio’s core animation system–if you’re looking for guidance on working with a GLTF model file's built-in animations see the Mesh section.

Components are provided for procedural animation, and can be split into two kinds:

  1. Transitions
  2. Relationships

Animations can be added to the entity via the editor or in code. Adding them in the editor is done via the "New Component" button:

AnimationNewComponent

Animations can also be added via code, using the component’s import name.

Transition animations

These animations transition an object from one state to another over time. There will be a 'from' and 'to' state, and the animation can either finish or be set to loop.

Editor Nameecs Import NameDescriptionEvent when Complete
Custom Property AnimationCustomPropertyAnimationAnimate a single number property on the attributes of a target objectanimation-complete
Position AnimationPositionAnimationAnimate the position of a target objectposition-animation-complete
Scale AnimationScaleAnimationAnimate the scale vector of a target objectscale-animation-complete
Rotate AnimationRotateAnimationAnimate the rotation of a target objectrotate-animation-complete
Custom Vec3 AnimationCustomVec3AnimationAnimate the named 3D vector attribute on a target objectvector-3-animation-complete

Properties on transition animations

PropertyDataComponentDescription
attributeStringCustom Property Animation, Custom Vec3 AnimationSelected attribute to animate (e.g. position, scale, material)
propertyStringCustom Property AnimationIndividual property to animate (e.g. x, y, or z for a vector attribute)
target (optional)Drop-down list of all objects in the hierarchyAllThe target object to animate. If 'none' selected then animation is run on the object that the component is attached to.
from/from(x, y, z)Number or 3D vectorAllThe starting state of the animation.
to/to(x, y,z)Number or 3D vectorAllThe ending state of the animation.
autoFromCheckboxAllIf enabled, ignore 'from' property and animate from the state of the object at the start of the animation.
durationNumber, in millisecondsAllLength of time that the animation runs.
loopCheckboxAllIf enabled, repeat the animation.
reverseCheckboxAllWhether to play in reverse, if loop set.
easeInCheckboxAllIf enabled, easing function will be applied over time instead of straight interpolation (quadratic by default)
easeOutCheckboxAllIf enabled, easing function will be applied over time instead of straight interpolation (quadratic by default)
easingFunctionName of easing to applyAllEasing options: Quadratic (default), Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back, Bounce

Relationship animations

These are animations that express a relationship between an object and a target. When running, they maintain that relationship for the object that they are attached to.

Editor Nameecs Import NameDescription
Follow Animation FollowAnimationFollow a target object at the given distance.
Look At AnimationLookAtAnimationMaintain orientation to face a given target or point.

Properties on relationship animations

PropertyDataComponentDescription
target Drop-down list of all objects in the hierarchyAllThe target object to track when animating. If 'none' selected then animation is disabled.
minDistanceDistance in metersfollow-animationMinimum distance to maintain when following.
maxDistanceDistance in metersfollow-animationMaximum distance to maintain when following.
elasticityNumber between 0-1follow-animationProportion of distance to move (per second) when target is outside of min/max distance (0 never moves, 1 is instantaneous)
target(x, y, z)3D vectorlook-at-animationTarget position to track when animating (if no target object set).