Skip to content
Back to skills

Godot Animation

ASecurity

Godot animation: AnimationPlayer and AnimationTree, state machines, blend spaces, clip libraries, root motion, track events; sliding feet.

  • 5 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added December 3, 2026
ai-agentspythongobashnodespringtesting

Works with

  • cli

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add tipoLi5890/game-studio --skill godot-animation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Godot Animation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Godot Animation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tipoli5890-godot-animation/badge)](https://www.skillsdirectory.com/skills/tipoli5890-godot-animation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: godot-animation
description: >-
  Godot animation: AnimationPlayer and AnimationTree, state machines, blend spaces, clip
  libraries, root motion, track events; sliding feet.
---

# godot-animation — clips, trees and root motion

An `AnimationTree` reads parameters gameplay sets; the clips stay in libraries. The tree is the
character's animation logic, and logic can be tested: run it by hand, a fixed step at a time,
headless, and check which state it is in, how far it moved and which events fired.

## Load what the situation needs

| The situation | Read |
|---|---|
| Clips into a player, libraries by name, building a clip in code | `reference/trees.md` §1 |
| A pose or property sticks after the clip changes; RESET | `reference/trees.md` §1, "A value that sticks" |
| A state machine: transitions, conditions, `travel()`, the playback object | `reference/trees.md` §2 |
| The tree sits in Start, or a state never leaves | `reference/trees.md` §2, "States that never leave" |
| Walk–run by speed: a blend space, its points, its parameter path | `reference/trees.md` §3 |
| Prove the transitions headless; a test that drives the tree frame by frame | `reference/trees.md` §4, `scripts/tree_probe.py` |
| One place where gameplay sets parameters and hears back | `reference/trees.md` §5, `resources/animation_bridge.gd` |
| Root motion: the track, what one update returns, into a CharacterBody3D | `reference/root-motion.md` §1–3 |
| Feet slide, or the character drifts back once a loop | `reference/root-motion.md` §4 |
| Footsteps, hit windows, the parcel hand-off from the clip; a call that never lands | `reference/events.md` |
| Clips arrive retargeted from the asset side, as an AnimationLibrary | `godot-rigged-character` → `reference/retarget.md` |

## Five rules the engine enforces silently

Each holds in a headless run, and none prints a warning:

1. **A transition made in code is Enabled, not Auto.** Out of Start that means the machine never
   leaves Start and plays nothing. Make the Start transition Auto.
2. **At End never fires from a looping clip.** Leave a looping state on a condition or with
   `travel()`; keep At End for clips that play once.
3. **A property keyed by one clip and not the next stays where it was**, unless
   `AnimationMixer.deterministic` is on and a RESET clip keys it.
4. **The update that enters a state returns no root motion**, and after a retarget the root
   track's keys are divided by `Skeleton3D.motion_scale`: read motion only through
   `get_root_motion_position()`, and measure over whole seconds plus one update.
5. **Method-track calls are deferred**: they land on the next frame, and a missing method is an
   `ERROR:` line while the clip plays on.

## Drive and check it headless

```bash
python3 scripts/tree_probe.py --project . --scene res://courier_3d.tscn --tree Courier/AnimationTree \
    --bridge Courier/AnimationBridge --set 1:parameters/Locomotion/blend_position=2 \
    --travel 30:Jump --expect 31:Jump --expect 70:Locomotion --frames 121
```

The probe loads the scene from the (imported) project with a script kept outside it, switches the
tree to Manual and advances it 1/60 s per frame, applying each `--set FRAME:PARAM=JSON` and
`--travel FRAME:STATE` before that frame's update. It prints the state timeline, the events the
bridge emitted and the root motion summed, then `tree_probe: PASS|FAIL ...`. Checks:
`--expect FRAME:STATE`, `--expect-moved X,Y,Z` (with `--tolerance`), `--expect-events N`, and
always frames that move against the run's direction. Exit 0 pass, 2 an expectation failed or an
error or warning line in the output, 3 nothing verified (no Godot, no sentinel, a scene or tree that
did not load), 1 usage. `--yaw 90` turns the character first, which proves root motion is turned
into world space.

## The bridge

`resources/animation_bridge.gd` is one node next to the tree. Gameplay calls
`set_speed(m_per_s)`, `set_condition(&"grounded", is_on_floor())` and `travel(&"Jump")`; clips call
its `anim_event(name)` from method tracks; it emits `state_changed(previous, current)` and
`animation_event(event)`, and turns root motion into a world velocity (`root_motion_velocity`),
moving `body` itself when `apply_root_motion` is on.

```gdscript
@onready var anim: Node = $AnimationBridge

func _ready() -> void:
	anim.animation_event.connect(_on_animation_event)

func _on_animation_event(event: StringName) -> void:
	if event == &"foot_left" or event == &"foot_right":
		$Footsteps.play()
```

## Discipline

- **Blend positions in m/s.** Place each clip at the speed it moves and pass the body's speed; the
  blend then matches the feet, and walk at 1, run at 2 blends to 1.5 m/s at 1.5.
- **One owner for the body's speed per state**: root motion (a vault, a climb) or gameplay (a run);
  never both at once.
- **Parameters from one place.** Gameplay writes through the bridge; two scripts writing one
  blend position fight every frame.
- **Name blend points.** `add_blend_point` without a name prints a `WARNING:` per point.
- **Events to one method on one node.** Every clip keys `anim_event` on the bridge; gameplay
  listens to a signal, and renaming gameplay code breaks no clip.
- **Test with a fixed step.** Manual process mode and `advance(1.0 / 60.0)`: the same frames on
  every machine, no window, no flake.
- **Look at it once in a window.** The probe proves states, distances and events; whether the feet
  plant and the blend reads well is a person's call on a windowed run.

## Scope — what this skill does NOT do

| Not here | Go to |
|---|---|
| Importing and retargeting a rigged character; clip files as a library; props and springs | `godot-rigged-character` |
| The model's import settings, loop suffixes, the budget audit | `godot-3d-models` |
| Moving the character: controller, grounding, camera | `godot-3d-controller` · `godot-camera` |
| Frame-by-frame sprite animation | `godot-2d-sprites` |
| Bones and weights on a 2D character | `godot-2d-rig` |
| A test runner, assertions, CI | `godot-testing` |
| Retargeting or baking clips in Blender | `blender-retarget` |

Files in this skill

  • SKILL.md6 KB
  • reference/events.md3 KB
  • reference/root-motion.md4.6 KB
  • reference/trees.md7.3 KB
  • resources/animation_bridge.gd3.1 KB
  • scripts/tree_probe.py21.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.