Godot animation tree mastery

From thedivergentai/GD-Agentic-Skills · View interactive version

Godot animation tree mastery is an AI agent skill from the GitHub repository thedivergentai/GD-Agentic-Skills. Expert patterns for AnimationTree including StateMachine transitions, BlendSpace2D for directional movement, BlendTree for layered animations, root motion, transition conditions, advance expressions, and state machine sub-states. Use for complex character animation systems with movement blending and

How to use this skill

Skill file

AnimationTree Mastery

Expert guidance for Godot's advanced animation blending and state machines.

NEVER Do


Available Scripts

MANDATORY: Read the appropriate script before implementing the corresponding pattern.

Do NOT Load references/advanced-graph-recipes.md unless nested combat graphs, IK look-at, or deep BlendTree layering are in scope.

[sync_parameter_manager.gd](scripts/sync_parameter_manager.gd)

Guarded AnimationTree parameter writes — prevent redundant set() churn every physics frame.

[statemachine_travel_code.gd](scripts/statemachine_travel_code.gd)

Programmatic AnimationNodeStateMachinePlayback via travel() / start().

[tree_travel_manager.gd](scripts/tree_travel_manager.gd)

Trigger: multi-machine travel / request queue. Centralizes travel requests across nested playback paths without calling AnimationPlayer.play().

[nested_state_machine.gd](scripts/nested_state_machine.gd)

Trigger: locomotion + combat (or air) sub-machines. Nested StateMachine parameter paths and playback handoff.

[skeleton_ik_lookat.gd](scripts/skeleton_ik_lookat.gd)

Trigger: aim/look-at beside the tree. LookAtModifier3D / IK that must not fight bone tracks the tree owns.

[reactive_oneshot_vfx.gd](scripts/reactive_oneshot_vfx.gd)

AnimationNodeOneShot for recoil, blinks, and hit reactions.

[dynamic_timescale_control.gd](scripts/dynamic_timescale_control.gd)

Runtime playback speed for bullet-time or haste multipliers.

[advanced_transition_masking.gd](scripts/advanced_transition_masking.gd)

Bone filter masks on Add2/Blend2 for upper/lower body separation.

[blendtree_logic_mixing.gd](scripts/blendtree_logic_mixing.gd)

Interactive combat layer mixing inside BlendTree graphs.

[root_motion_animtree_sync.gd](scripts/root_motion_animtree_sync.gd)

CharacterBody motion extraction from AnimationTree root motion.

[sync_group_layering.gd](scripts/sync_group_layering.gd)

Sync groups for multi-layer clips that share length (e.g. walk + reload).

[nested_tree_architecture.gd](scripts/nested_tree_architecture.gd)

Hierarchical StateMachine / nested parameter path architecture.

[runtime_tree_debugging.gd](scripts/runtime_tree_debugging.gd)

Visualize current states, travel paths, and blend values at runtime.

[animation_event_dispatcher.gd](scripts/animation_event_dispatcher.gd)

Method-track → dispatch_event(name, metadata) signal bridge; decouple VFX/audio from graph code.

[animation_complexity_manager.gd](scripts/animation_complexity_manager.gd)

Swap tree_root hero vs crowd graph when VisibleOnScreenNotifier3D culls off-screen actors.


Decision Tree (replace inline tutorials)

| Need | Prefer | Script |

|------|--------|--------|

| Simple clip swap / UI / prop | AnimationPlayer only | Peer godot-animation-player |

| 5+ gameplay states, travel | StateMachine root | statemachine_travel_code.gd, tree_travel_manager.gd |

| Speed only blend | BlendSpace1D | Guarded writes via sync_parameter_manager.gd |

| Strafe / aim X+Y | BlendSpace2D | Same + blend_position |

| Upper-body overlay / combat layer | BlendTree Add2/Blend2/OneShot | blendtree_logic_mixing.gd, reactive_oneshot_vfx.gd |

| Nested combat/air under locomotion | Nested SM | MANDATORY nested_state_machine.gd |

| Look-at / IK | Modifier beside tree | MANDATORY skeleton_ik_lookat.gd |

| Deep graph recipes | references/ | Do NOT Load unless needed → advanced-graph-recipes.md |

Core Concepts (compact): AnimationTree owns an AnimationPlayer via anim_player; root is StateMachine / BlendTree / BlendSpace; parameters use relative "parameters/..." paths; set active = true once in _ready.

@onready var anim_tree: AnimationTree = $AnimationTree
@onready var playback: AnimationNodeStateMachinePlayback = anim_tree.get("parameters/StateMachine/playback")

func _ready() -> void:
    anim_tree.active = true

Do not paste full StateMachine/BlendSpace editor walkthroughs — author graphs in the AnimationTree editor, then drive them with the scripts above.


Expert insights (WHY — keep in body)

Deep recipes (on demand)

| Topic | Reference / script |

|-------|-------------------|

| StateMachine / BlendSpace editor recipes | statemachine-and-blendspace.md |

| Nested combat / IK / root motion | advanced-graph-recipes.md |

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API;

load Related Skills when routing work to a peer domain — do not preload the whole lattice.

Official Documentation

Related Skills

Prerequisites
Complements
Downstream / consumers
Master
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.