godot-animation

Installation
SKILL.md

Animation (4.7)

Asset-side work (rigging, clips, root motion export) belongs in Blender. See the blender-animation and blender-export-pipelines skills if they're installed.

AnimationPlayer

  • Animations live in AnimationLibrary resources. The default library is "", so play(&"run") works, and other libraries are addressed as &"lib/run". Imported GLB clips arrive as a library. Make a clip loop in the import settings (or with a -loop suffix) instead of editing the imported animation.
  • play(name, custom_blend, speed), play_backwards, queue, seek(t, true), speed_scale. The animation_finished(name) signal lives on AnimationMixer. play_with_capture blends from the current pose.
  • Tracks can set any property, call methods (TYPE_METHOD), play audio, run Bezier curves or start other animations. Use method tracks for footsteps and hit frames instead of timers.
  • 4.6 C# break: current_animation, assigned_animation and autoplay are StringName.

AnimationTree (use it for any character with more than ~3 states)

  • Set anim_player and a tree_root (AnimationNodeStateMachine or AnimationNodeBlendTree). The AnimationPlayer becomes a clip container only, so don't call play() on it anymore.
  • Drive it through parameters (anim_tree.set("parameters/…", v), or anim_tree["parameters/…"] = v in GDScript):
    • State machine: var pb: AnimationNodeStateMachinePlayback = tree["parameters/playback"], then pb.travel(&"Jump") (pathfinds through transitions), pb.start(&"Idle"), pb.get_current_node().
    • Conditions on transitions: parameters/conditions/is_grounded = true. Advance expressions: set advance_expression_base_node and write expressions like velocity.length() > 0.1.
    • Blend space: parameters/Locomotion/blend_position = Vector2(x, y) (or a float for 1D).
    • One-shot: parameters/Attack/request = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE. Transition node: parameters/State/transition_request = "crouch".
  • 4.7: blend spaces use sync_mode (SYNC_MODE_NONE, INDEPENDENT, CYCLIC_MUTABLE, CYCLIC_CONSTANT) instead of the old sync bool. Cyclic modes keep walk and run feet in phase.
  • callback_mode_process: physics for gameplay-synced characters, idle for visuals. Use MANUAL + advance(delta) for deterministic or networked playback.
Installs
12
GitHub Stars
54
First Seen
9 days ago