godot-animation
できること
Godotでどのアニメーションのツールを使うべきか、そして各ツールをどう設定するかを説明します。Godotで、キャラクター、スプライトシート、UI要素をアニメーションさせる開発者向けです。
使う場面
- ✓Godotで、キャラクターやオブジェクトのキーフレームのクリップが必要なとき。
- ✓キャラクターが歩き、走り、待機のアニメーションを状況に応じて混ぜる必要があるとき。
- ✓コードでTweenを使い、UIのポップやフェードを素早く作りたいとき。
スキルのリンク
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-animation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“Godotのキャラクターが、速さに応じて待機、歩き、走りのアニメーションを切り替えるようにしたいです。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、AnimationPlayerの中にクリップを作り、そのあとでステートマシンまたはブレンドスペースを持つAnimationTreeを加えて、それらのどれを再生するかを選ばせます。素早い効果には、コードでTweenを使います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
- 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 anAnimationPlayerto pull clips from.Tween— fire-and-forget procedural interpolation in code (create_tween()); ideal for UI pops, fades, and one-off moves.
- For 2D sprite sheets: use
AnimatedSprite2D+SpriteFrames, or keyframe theframeproperty in anAnimationPlayer. - For characters: build clips in
AnimationPlayer, then add anAnimationTree(active = true), set itsanim_player, and design anAnimationNodeStateMachineorAnimationNodeBlendSpace2Das the tree root. - Drive transitions from code via the playback object (
travel) or by setting blend parameters. - React to clip events with the
animation_finishedsignal and Call Method tracks.
Patterns
1. AnimationPlayer: play a clip and await it
@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
@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
# 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)
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.activeleft false → nothing animates andtravel()appears to do nothing. Setactive = trueand assign theanim_playerpath.- 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
AnimationTreeis active, don't also callAnimationPlayer.play()for the same tracks — let the tree own playback. - 3.x Tween node is gone. There is no
Tweennode to add in 4.x; create tweens in code withcreate_tween()(which returns aTween). 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. Useget_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
Containersnaps back → the container resets child transforms whenever it re-sorts. In 4.7+ set `of
よくある質問
AnimationPlayerとTweenの違いは何ですか?
AnimationPlayerは作り込まれたキーフレームのクリップを保持し、Tweenはコードで短い補間を実行します。
スプライトシートも扱いますか?
はい。SpriteFramesを使ったAnimatedSprite2Dや、frameプロパティのキーフレーム化を扱います。
どの状態を再生するかも決めますか?
いいえ。どの状態を選ぶかのロジックは、Godotの2D移動のスキルに属します。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 6.6k
- ランキング
- #13818
- ライセンス
- Apache-2.0
- 更新日
- 2026/10/28
コメント
- …
このリポジトリの他のスキル
router
6.6kエージェントが、エンジンとタスクの種類を見分けて、依頼に合ったゲーム開発のスキルを選べるよう支援します。
ai-behavior-trees-utility-ai
6.6kエージェントが、優先度と点数によって行動を選ぶ、ゲームの敵やキャラクター向けのビヘイビアツリーとユーティリティAIのシステムを作れるよう支援します。
audio-design
6.6kエージェントが、オーディオバス、デシベルでの音量、会話中の音の抑え込み(ダッキング)、適応型の音楽、効果音のバリエーションなど、ゲームのサウンドのミキシングを教えます。
camera-systems
6.6kエージェントが、なめらかに追従し、レベルの内側に収まり、3Dで周回したり見回したりできるゲームのカメラを作れるよう支援します。
似ているスキル
blender-motion-state-inspection
280k3Dアニメーションの細部を確認できるようにします。ポーズ、動き、キャラクターの位置合わせをチェックするのに役立ちます。
manim-video
280kエージェントがアニメーション付きの解説動画を作成するのを支援します。Manimを使い、技術的な概念を分かりやすく示すグラフや図を生成します。
remotion-video-creation
280kReactとライブラリの Remotion を使って、エージェントが動画を作成するためのガイドです。アニメーション、音声、字幕などの視覚要素に関するベストプラクティスを扱います。