godot-animation-tree-mastery
Installation
SKILL.md
AnimationTree Mastery
Expert guidance for Godot's advanced animation blending and state machines.
NEVER Do
- NEVER call
play()on AnimationPlayer when using AnimationTree — AnimationTree controls the player. Directly callingplay()causes conflicts and jitter. Useset("parameters/transition_request")ortravel()instead [12]. - NEVER forget to set
active = true— AnimationTree is inactive by default. Animations won't play until$AnimationTree.active = true[13]. - NEVER use absolute paths for parameter access — Use relative paths like
"parameters/StateMachine/transition_request". This ensures compatibility when nodes move in the hierarchy [14]. - NEVER leave
auto_advanceenabled for interactive states — It causes immediate transitions. Use it only for automated sequences like combo chains or death-to-respawn [15, 121]. - NEVER use
BlendSpace2Dfor 1D blending — Blending only speed? UseBlendSpace1D. Blending only two states? UseBlend2.BlendSpace2Dis specifically for X+Y directional inputs (strafe) [16, 142]. - NEVER update
AnimationTreeparameters every frame without a guard — Setting parameters viaset()every frame regardless of change causes cache invalidation and potential stutter. Check equality first. - NEVER use deep, nested
BlendTreesfor simple logic — Every layer adds CPU overhead. If logic can be handled in aStateMachineor a simple script-drivenBlend2, do it there. - NEVER forget to handle
await get_tree().process_framewhen updating parameters synchronously — Sometimes the tree needs one frame to reconcile state before the next parameter change takes effect. - NEVER rely on
auto_advancefor long cutscenes — If an animation is interrupted,auto_advancecan put the character in a broken state. UseMethod Tracksto signal state completion instead. - NEVER use
Syncgroups for animations with wildly different lengths — It forces one animation to play at an extreme speed. UseTimeScaleor separate layers for mismatching cycles.