Core Animation Concepts
The animation system in Godot is based on keyframe animation, where you define specific values at specific times, and the engine automatically interpolates between them.Animation Resource
At the heart of the system is theAnimation resource, which stores animation data including:
- Tracks: Different types of data that can be animated
- Keyframes: Specific values at specific points in time
- Length: Total duration of the animation
- Loop Mode: How the animation repeats (none, linear, or ping-pong)
Track Types
Godot supports multiple track types for animating different kinds of data:Property Tracks (Value Tracks)
Animate any property of a node, such as position, color, or custom properties.- Type:
Animation.TYPE_VALUE - Interpolation: Nearest, Linear, Cubic, Linear Angle, Cubic Angle
- Update Mode: Continuous, Discrete, or Capture
Transform Tracks
Specialized tracks for 3D transformations that can be compressed for better performance:- TYPE_POSITION_3D: Position in 3D space (Vector3)
- TYPE_ROTATION_3D: Rotation using quaternions
- TYPE_SCALE_3D: Scale in 3D space (Vector3)
- TYPE_BLEND_SHAPE: Blend shape/morph target values
Method Call Tracks
Call methods on nodes at specific times during animation playback.Bezier Curve Tracks
Create smooth, custom interpolation curves for advanced animation control.- Type:
Animation.TYPE_BEZIER - Provides precise control over animation timing and easing
- Uses cubic Bezier curves with adjustable handles
Bezier tracks are particularly useful for creating custom easing functions and smooth camera movements.
Audio and Animation Tracks
- TYPE_AUDIO: Play audio streams synchronized with animation
- TYPE_ANIMATION: Play other animations as part of an animation
Interpolation Types
Godot provides several interpolation methods for smooth transitions between keyframes:Nearest
No interpolation - snaps to the nearest keyframe value
Linear
Straight-line interpolation between keyframes
Cubic
Smooth cubic interpolation with automatic tangent calculation
Angle Interpolation
Specialized interpolation for rotations (linear or cubic)
Update Modes
Property tracks support different update modes:- UPDATE_CONTINUOUS: Smoothly interpolates values every frame
- UPDATE_DISCRETE: Updates only on keyframes (no interpolation)
- UPDATE_CAPTURE: Captures the current value before animation starts for smooth transitions
Loop Modes
Animations can be configured to loop in different ways:Animation Libraries
Animations are organized intoAnimationLibrary resources, which can contain multiple animations:
Working with Keyframes
Keyframes are the foundation of animation. Each keyframe has:- Time: Position in the animation timeline (in seconds)
- Value: The property value at that time
- Transition: Easing/transition value (default 1.0 for linear)
Adding Keyframes
Animation Step
The animation step defines the granularity of keyframe placement:1.0 / 30 (approximately 0.033 seconds, or 30 FPS).
Next Steps
Now that you understand the core animation concepts, explore how to use them:AnimationPlayer
Learn how to play and control animations in your game
AnimationTree
Create complex animation blending and state machines
Skeletal Animation
Animate 3D characters with bones and skeletons