Skip to main content
The AnimationTree node provides advanced animation capabilities beyond what AnimationPlayer offers. It enables complex animation blending, state machines, blend spaces, and layered animation control.
AnimationTree works alongside an AnimationPlayer. The AnimationPlayer stores the animations, while AnimationTree controls how they blend and transition.

Getting Started

Basic Setup

1

Add AnimationPlayer

Create an AnimationPlayer node and add your animations to it.
2

Add AnimationTree

Add an AnimationTree node as a sibling to the AnimationPlayer.
3

Link to AnimationPlayer

Set the anim_player property to point to your AnimationPlayer node.
4

Create Tree Root

Create a root animation node (usually AnimationNodeStateMachine or AnimationNodeBlendTree).
5

Activate

Set the active property to true.

Animation Nodes

AnimationTree uses a graph of AnimationNode objects to control animation blending. Each node type serves a specific purpose.

AnimationNodeAnimation

Plays a single animation from the AnimationPlayer:

AnimationNodeBlendTree

A container for creating custom animation blend graphs:
  • Combine multiple animations with different blend modes
  • Create complex animation layering
  • Add custom blend nodes

AnimationNodeStateMachine

Creates a state machine for animation transitions:
  • Define animation states
  • Set up transitions between states
  • Control flow with conditions

State Machines

State machines are the most common way to organize character animations.

Creating a State Machine

Adding States and Transitions

In the editor or through code:

Transition Properties

AnimationNodeStateMachineTransition controls how states blend:
  • xfade_time: Crossfade duration in seconds
  • advance_mode: AUTO (automatic) or ENABLED (manual)
  • advance_condition: Expression or parameter name to trigger transition
  • advance_expression: Custom expression for complex conditions
  • priority: Higher priority transitions are checked first

Advance Conditions

Blend Spaces

Blend spaces allow you to blend between multiple animations based on 2D or 1D input.

AnimationNodeBlendSpace2D

Blend animations in 2D space (e.g., directional movement):

AnimationNodeBlendSpace1D

Blend animations along a single axis (e.g., walk to run speed):

Blend Nodes

AnimationNodeBlend2

Blends two animations with a single blend amount:

AnimationNodeBlend3

Blends three animations:

AnimationNodeAdd2 / AnimationNodeAdd3

Additive blending for layering animations:

AnimationNodeOneShot

Plays a one-shot animation over the base animation:

AnimationNodeTransition

Switches between multiple animations:

Animation Node Parameters

Access and modify animation node parameters:

Root Motion

Extract movement from animations for character controllers:
Root motion allows animations to directly drive character movement, ensuring perfect synchronization between animation and gameplay.

Filters

Control which bones/properties are affected by specific nodes:

Complete Example: Character Controller

Best Practices

State machines are ideal for character animations with clear states (idle, walk, run, jump, etc.).
2D blend spaces work great for 8-directional movement or aiming animations.
Use additive blending for upper body animations that play over locomotion.
Enable filters to have different animations affect different body parts.

Next Steps

Skeletal Animation

Learn about 3D character animation with bones and IK

AnimationPlayer

Review basic animation playback concepts