Animation
The animation component is a component that animates an entity according to a collection of keyframes. For further details on all properties associated with this component and how to use this component with scripting, please see the API documentation.
The animation component is typically used for very simple animations, such as camera animations for recording videos. Note that scrolling through the timeline does not preview the animation. You must run the simulation to show/test the animation. The animation component should not be used for simulating machines/robots/mechanisms. Physics with joints and motors should be used instead.
Usage
The general procedure to animate an entity:
- Add the animation component to the entity that you want to animate.
- Scroll through the timeline to the time at which you want to create a keyframe.
- Move/rotate/scale the entity to the position/orientation/scale that you want at that keyframe.
- Click the button to add a keyframe and adjust the interpolation mode as desired.
- Repeat steps 2-4, adding any additional keyframes.
Properties
The animation component properties that are accessible through the inspector.
Timeline
The timeline contains the keyframes for the animation. A keyframe stores the state of the transform component of the entity (local position, local rotation, local scale) and the interpolation mode.
You can move the timeline forwards and backwards using the scroll wheel on your mouse. Scroll downwards to move forwards in time and scroll upwards to move backwards in time (100ms increments). You can hold SHIFT and scroll to move the timeline faster (1s increments).
The buttons under the timeline perform the following actions:
- Add - Adds a new keyframe to the timeline at the marked time.
- Remove: - Removes a keyframe from the timeline, if a keyframe exists at the marked time.
- Previous: - Moves the marker to the previous keyframe.
- Backwards: - Moves the marker backwards 100ms.
- Forwards: - Moves the marker forwards 100ms.
- Next: - Moves the marker to the next keyframe.
- Copy/Paste: - Click to copy the keyframe. Click again to paste the keyframe.
- Transition: - Changes the interpolation mode for the keyframe.
The keyframe interpolation mode is one of the following:
- Linear: - Linearly interpolates between keyframes.
- EaseIn - Eases in between keyframes, increasing speed over time.
- EaseOut: - Eases out between keyframes, decreasing speed over time.
- EaseInOut: - Eases in and out between keyframes, accelerating and then decelerating.
- Step: - Teleports between keyframes.
Repeat
Causes the animation to cycle after reaching the last keyframe.