Skip to main content
skill CX Codex

godot-animation — Claude Code skill: animation and setup

This skill guides Godot 4.7 animation with AnimationPlayer, AnimationTree, and Tween. Use it for characters, sprite sheets, or code-driven UI motion.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code
Open on GitHub

What godot-animation does

The skill covers three animation tools in Godot 4.7. AnimationPlayer stores keyframed clips with property changes, method calls, audio, and other animations. AnimationTree blends those clips and moves between states with a state machine or blend space. Tween handles short procedural transitions created in code with create_tween().

Its workflow covers 2D sprite sheets, character locomotion, UI motion, blend parameters, travel, the animation_finished signal, and Call Method tracks. AnimationTree needs an AnimationPlayer, an assigned anim_player path, and active = true. If active stays false, animation playback and travel() do nothing. In Godot 4.x, there is no separate Tween node; create tweens in code instead.

What it helps with

  • choose between clips, blended states, and procedural motion
  • switch character states through an AnimationTree state machine
  • blend movement direction with AnimationNodeBlendSpace2D
  • animate a 2D sprite sheet with AnimatedSprite2D
  • create UI fades and scale changes with Tween

Example prompts for the agent

  • Use godot-animation to set up an AnimationTree with idle, run, and attack states in a Godot 4.7 scene.
  • Apply godot-animation and write GDScript for a Tween that changes a UI element’s scale and modulate:a.
  • Use godot-animation to animate a sprite sheet with AnimatedSprite2D and SpriteFrames.

How to install godot-animation

1Skills CLI (Vercel)

npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code

2Manually: put the files in place

~/.claude/skills/godot-animation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/godot-animation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about godot-animation

How do I install godot-animation in Claude Code?

Run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code, then run npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code again. The skill file is at ~/.claude/skills/godot-animation/SKILL.md.

What does godot-animation do?

It helps choose and use AnimationPlayer, AnimationTree, or Tween for Godot 4.7 animation. The workflow covers clips, state machines, blend spaces, sprite sheets, and procedural UI motion.

Does AnimationTree need AnimationPlayer?

Yes. AnimationTree pulls its clips from AnimationPlayer; set anim_player, enable active, and then drive states or blend parameters.

Source text

SKILL.md · Apache-2.0
---
name: godot-animation
description: >
  Animate in Godot 4.7 three ways: AnimationPlayer for keyframed clips (incl. Call
  Method tracks), AnimationTree with state machines and blend spaces for
  character animation, and Tween for short procedural/UI tweens via create_tween().
  Use when working with AnimationPlayer/AnimationTree nodes in a .tscn, blending
  character states, sprite-sheet animation, or code-driven Tweens.
---

# Godot Animation (4.x)

Choose and drive the right animation tool: `AnimationPlayer` (clips), `AnimationTree`
(blending/state machines), or `Tween` (short procedural moves). Targets **Godot 4.7**.

## When to use

- Use when playing keyframed animations, blending walk/run/idle states, animating a
  sprite sheet, or tweening UI/objects in code.

**When *not* to use:** the movement *logic* that decides which state to play →
`godot-2d-movement`; UI layout (vs. UI tweening) → `godot-ui-control`; shader-driven
effects → `godot-shaders`.

## Core workflow

1. **Pick the tool:**
   - `AnimationPlayer` — author keyframed clips (transforms, properties, method calls,
     audio, even other animations). The source of truth for clip data.
   - `AnimationTree` — blend and transition between those clips at runtime with a state
     machine and/or blend spaces. Needs an `AnimationPlayer` to pull clips from.
   - `Tween` — fire-and-forget procedural interpolation in code (`create_tween()`); ideal
     for UI pops, fades, and one-off moves.
2. **For 2D sprite sheets:** use `AnimatedSprite2D` + `SpriteFrames`, or keyframe the
   `frame` property in an `AnimationPlayer`.
3. **For characters:** build clips in `AnimationPlayer`, then add an `AnimationTree`
   (`active = true`), set its `anim_player`, and design an `AnimationNodeStateMachine` or
   `AnimationNodeBlendSpace2D` as the tree root.
4. **Drive transitions from code** via the playback object (`travel`) or by setting blend
   parameters.
5. **React to clip events** with the `animation_finished` signal and Call Method tracks.

## Patterns

### 1. AnimationPlayer: play a clip and await it

```gdscript
@onready var anim: AnimationPlayer = $AnimationPlayer

func attack() -> void:
    anim.play("attack")
    await anim.animation_finished     # resume after the clip ends
    anim.play("idle")
```

### 2. AnimationTree state machine: travel between states

```gdscript
@onready var tree: AnimationTree = $AnimationTree

func _ready() -> void:
    tree.active = true                # the tree drives animation; AnimationPlayer is the source

func set_state(state: StringName) -> void:
    # The playback object controls an AnimationNodeStateMachine root.
    var sm: AnimationNodeStateMachinePlayback = tree.get("parameters/playback")
    sm.travel(state)                  # transitions using the graph's connections

func _physics_process(_d: float) -> void:
    set_state(&"run" if velocity.length() > 5.0 else &"idle")
```

### 3. Blend space: blend run direction by a 2D parameter

```gdscript
# Root is an AnimationNodeBlendSpace2D named "Move" with idle/run points placed in it.
func update_locomotion(input_dir: Vector2) -> void:
    # Parameter path = "parameters/<node name>/blend_position".
    tree.set("parameters/Move/blend_position", input_dir)
```

### 4. Tween: fade and scale a UI element (code-driven)

```gdscript
func pop_in(node: Control) -> void:
    node.scale = Vector2.ZERO
    node.modulate.a = 0.0
    var tw := create_tween()                          # bound to this node's tree
    tw.set_parallel(true)                             # run the two tweens together
    tw.tween_property(node, "scale", Vector2.ONE, 0.2) \
      .set_trans(Tween.TRANS_BACK).set_ease(Tween.EASE_OUT)
    tw.tween_property(node, "modulate:a", 1.0, 0.2)   # sub-property via ":"
```

## Pitfalls

- **`AnimationTree.active` left false** → nothing animates and `travel()` appears to do
  nothing. Set `active = true` and assign the `anim_player` path.
- **Wrong parameter path.** Blend/condition paths are `"parameters/<NodeName>/..."` and
  must match the node names in the tree exactly (e.g. `"parameters/playback"`,
  `"parameters/Move/blend_position"`). A typo silently no-ops.
- **AnimationPlayer and AnimationTree fighting.** When an `AnimationTree` is active, don't
  also call `AnimationPlayer.play()` for the same tracks — let the tree own playback.
- **3.x Tween node is gone.** There is no `Tween` node to add in 4.x; create tweens in
  code with `create_tween()` (which returns a `Tween`). They auto-start and free themselves.
- **Tween stalls when its node leaves the tree.** `node.create_tween()` pauses while that
  node is outside the tree and dies when it is freed. Use `get_tree().create_tween()` for a
  tween that must keep running while the node is out of the tree.
- **Scale/rotation tween on a child of a `Container` snaps back** → the container resets
  child transforms whenever it re-sorts. In 4.7+ set `offset_transform_enabled = true` and
  tween `offset_transform_scale` / `offset_transform_rotation` / `offset_transform_position`
  instead (visual only by default).
- **Reusing a finished tween.** A tween is one-shot; call `create_tween()` again for a new
  animation. Use `set_loops()` for repetition.
- **`yield`/`yield(anim, "...")` is gone.** Use `await anim.animation_finished`.
- **Sub-property tweens** use a colon: `"modulate:a"`, `"position:x"`. Tweening the whole
  property instead overwrites siblings.

## References

- For state machine transitions/conditions, root motion, one-shot/blend nodes, method &
  call tracks, `SpriteFrames`/`AnimatedSprite2D`, and Tween easing/chaining/callbacks,
  read `references/animation-tree-and-tween.md`.

## Related skills

- `godot-2d-movement` — supplies the velocity/state that selects animations.
- `godot-ui-control` — UI that Tweens animate.
- `godot-3d-essentials` — 3D character scenes driven by AnimationTree.
- `game-ai` — state machines that mirror animation states.

© gamedev-skills · Apache-2.0 · gamedev-skills/awesome-gamedev-agent-skills

Similar skills

Everything for Game dev and 3D: Unity, Unreal, Godot, Blender →

From the same set77

physics-tuning Stabilizes game physics by fixing jitter, tunneling, and floaty movement. Helps balance fixed-step simulation with the render loop. CX Codex +1 6,900installs dialogue-systems Guides the design of branching game dialogue, condition-gated choices, and the choice between Ink, Yarn Spinner, or a custom JSON runner. CX Codex +1 6,800installs create-game-assets A skill that carries a game's art from style brief and asset manifest to alpha checks and contact sheets. Handy once sprites start drifting out of style. CX Codex +1 6,700installs router Dispatches game development tasks to specialized skills by detecting the project engine and classifying gameplay or shipping workflows. CX Codex +1 6,600installs godot-ui-control A Claude Code skill that teaches the agent to lay out Godot 4.7 HUDs and menus with Control nodes: anchors, containers, themes and focus. CX Codex +1 6,700installs godot-nodes-scenes Teaches the agent to build a Godot 4.7 project from nodes and scenes: reusable .tscn files, runtime instancing, autoload singletons, and node lookups that survive renames. CX Codex +1 6,400installs godot-gdscript Guides coding assistants in writing statically typed GDScript 2.0 for Godot 4.7 and porting legacy scripts from Godot 3.x. Helpful when structuring node lifecycles and signals. CX Codex +1 6,500installs godot-shaders A skill that teaches your agent to write canvas_item and spatial shaders in the Godot Shading Language, with TIME animation, uniforms and screen reading. For 2D and 3D effects in Godot 4.7. CX Codex +1 6,500installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor