К основному содержанию
скилл CX Codex

godot-animation — скилл для Claude Code: анимация и установка

Скилл подсказывает, как собирать анимации в Godot 4.7 через AnimationPlayer, AnimationTree и Tween. Пригодится для персонажей, спрайтов и UI.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code
Открыть на GitHub

Что делает godot-animation

Скилл разбирает три инструмента Godot 4.7. AnimationPlayer хранит клипы с ключевыми кадрами, свойствами, вызовами методов и аудио. AnimationTree смешивает клипы и переключает состояния через state machine или blend space, а Tween запускает короткие процедурные переходы из кода через create_tween().

Внутри есть рабочий порядок для 2D sprite sheet, персонажей и UI, примеры на GDScript, переходы через travel, параметры blend space, сигнал animation_finished и Call Method tracks. AnimationTree требует AnimationPlayer; для него также нужно включить active и задать путь к источнику клипов. Если оставить active = false, анимация и travel() не сработают. В Godot 4.x отдельного узла Tween уже нет: его создают кодом.

Какие задачи решает

  • выбрать инструмент для клиповой, смешанной или процедурной анимации
  • переключать состояния персонажа через AnimationTree
  • смешивать направление движения в AnimationNodeBlendSpace2D
  • анимировать sprite sheet в 2D-сцене
  • сделать fade, scale и другие переходы UI через Tween

Примеры запросов агенту

  • Используй godot-animation, чтобы настроить AnimationTree для состояний idle, run и attack в сцене Godot 4.7.
  • Примени godot-animation и покажи GDScript для Tween, который меняет scale и modulate:a у элемента UI.
  • С помощью godot-animation добавь анимацию sprite sheet через AnimatedSprite2D и SpriteFrames.

Как установить godot-animation

1Через Skills CLI (Vercel)

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

2Вручную: положить файлы

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

Папка скилла целиком; для одного проекта — .claude/skills/godot-animation/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о godot-animation

Как установить godot-animation в Claude Code?

Выполните npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code, затем повторите npx skills add gamedev-skills/awesome-gamedev-agent-skills --skill godot-animation -a claude-code. Файл скилла находится по пути ~/.claude/skills/godot-animation/SKILL.md.

Что делает godot-animation?

Скилл помогает выбирать между AnimationPlayer, AnimationTree и Tween для анимации в Godot 4.7. Он показывает настройку клипов, state machine, blend space, sprite sheet и процедурных переходов UI.

Нужен ли AnimationPlayer для AnimationTree?

Да. AnimationTree берёт клипы из AnimationPlayer; затем можно включить active и управлять состояниями через playback object или параметр blend space.

Исходный текст

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

Похожие скиллы

Всё по теме «Геймдев и 3D: Unity, Unreal, Godot, Blender» →
godot-asset-generator agent-skills Скилл генерирует 2D-спрайты, тайлсеты и интерфейсы через нейросети и готовит их для Godot 4.x. Пригодится при сборке графики для прототипов и спрайтовых игр. CX Codex +1 1 000установок godot-tweening thedivergentai Скилл с правилами программной анимации в Godot через Tween. Помогает настроить переходы интерфейса, кривые сглаживания и безопасный жизненный цикл твинов. CX Codex +1 475установок godot-2d-animation thedivergentai Скилл передаёт агенту проверенные шаблоны 2D-анимации в Godot: от спрайтовых последовательностей до процедурного сжатия и скелетных ригов. Он нужен при рассинхроне кадров и настройке физики. CX Codex +1 684установок godot-ui Zate Скилл даёт агенту знания о Control-нодах, темах и типовых экранах Godot. Пригодится, когда собираешь меню, HUD или инвентарь. CX Codex +1 2 700установок godot-best-practices agent-skills Задаёт правила архитектуры и стандарты GDScript для Godot 4.x. Помогает агенту связывать узлы через сигналы, типизировать переменные и настраивать загрузку ресурсов. CX Codex +1 2 100установок spritecook-use-assets-in-godot SpriteCook Переносит спрайт-листы SpriteCook в Godot: собирает ресурс SpriteFrames и узел AnimatedSprite2D. Пригодится, когда анимации уже нарисованы, а в движке их ещё нет. CX Codex +1 555установок

Из того же набора77

physics-tuning Настраивает игровую физику: устраняет дрожание, прохождение сквозь стены и нестабильность тел. Помогает подружить фиксированный шаг расчёта с рендером. CX Codex +1 6 900установок dialogue-systems Скилл помогает проектировать ветвящиеся диалоги в играх, связывать реплики с условиями и выбирать между Ink, Yarn Spinner или собственным JSON-графом. CX Codex +1 6 800установок create-game-assets Скилл ведёт визуальные ассеты игры от арт-дирекшна и манифеста до проверки альфа-канала и контактного листа. Полезен, когда спрайты и тайлсеты начинают расползаться по стилю. CX Codex +1 6 700установок router Диспетчер геймдев-скиллов: определяет игровой движок по файлам репозитория и подбирает точный набор инструкций под задачу. CX Codex +1 6 600установок godot-ui-control Скилл для Claude Code учит агента верстать HUD и меню в Godot 4.7 на Control-нодах: якоря, контейнеры, тема, фокус. CX Codex +1 6 700установок godot-nodes-scenes Учит агента собирать проект Godot 4.7 из узлов и сцен: делать переиспользуемые .tscn, ставить инстансы в рантайме и не падать на удалённых узлах. CX Codex +1 6 400установок godot-gdscript Помогает писать типизированный код на GDScript 2.0 для Godot 4.7 и обновлять старые скрипты с версии 3.x. Пригодится при отладке логики узлов, сигналов и корутин. CX Codex +1 6 500установок godot-shaders Скилл учит агента писать canvas_item и spatial шейдеры на Godot Shading Language: анимация по TIME, юниформы, чтение экрана. Пригодится, когда нужен эффект в 2D или 3D без ручного перебора вариантов. CX Codex +1 6 500установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой