godot-animation
Ce qu’il fait
Explique quel outil d'animation Godot utiliser et comment configurer chacun. Elle s'adresse aux développeurs Godot qui animent des personnages, des feuilles de sprites et des éléments d'interface.
Quand l’utiliser
- ✓Quand vous avez besoin de clips à images clés pour un personnage ou un objet dans Godot.
- ✓Quand un personnage doit passer en fondu entre les animations de marche, de course et d'attente.
- ✓Quand vous voulez un effet rapide d'apparition ou de fondu d'interface par un Tween dans le code.
Lien du skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/godot/godot-animation/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Je veux que mon personnage Godot passe en fondu entre les animations d'attente, de marche et de course selon sa vitesse.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent crée les clips dans un AnimationPlayer, puis ajoute un AnimationTree avec une machine à états ou un espace de mélange qui choisit entre eux. Pour les effets rapides, il utilise un Tween dans le code.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis 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
Questions fréquentes
Quelle est la différence entre AnimationPlayer et Tween ?
AnimationPlayer contient des clips à images clés créés à la main, tandis que le Tween exécute une courte interpolation dans le code.
Couvre-t-elle les feuilles de sprites ?
Oui. Elle couvre AnimatedSprite2D avec SpriteFrames, ou l'animation de la propriété de frame par images clés.
Décide-t-elle quel état jouer ?
Non. La logique qui choisit l'état relève de la compétence de mouvement 2D de Godot.
Détails
Description originale de l’auteur
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.
Popularité
- Étoiles GitHub
- 6.6k
- Position au classement
- #13818
- Licence
- Apache-2.0
- Mis à jour
- 28/10/2026
Commentaires
- …
Autres skills de ce dépôt
router
6.6kAide votre agent à choisir la bonne compétence de développement de jeu pour une demande, en détectant votre moteur et le type de tâche.
ai-behavior-trees-utility-ai
6.6kAide votre agent à construire un arbre de comportement et une IA par utilité pour des ennemis qui choisissent leurs actions selon priorité et score.
audio-design
6.6kApprend à votre agent le mixage audio de jeu : bus, volume en décibels, baisse sous les dialogues, musique adaptative et variation des effets sonores.
camera-systems
6.6kAide votre agent à construire des caméras de jeu qui suivent en douceur, restent dans le niveau, et pivotent ou regardent autour en 3D.
Skills similaires
blender-motion-state-inspection
280kPermet d'inspecter les détails des animations 3D. Utile pour vérifier les poses, les mouvements et l'alignement des personnages dans les animations.
manim-video
280kPermet à votre agent de créer des vidéos explicatives animées. Il utilise Manim pour générer des graphiques et schémas clairs pour les concepts techniques.
remotion-video-creation
280kGuide votre agent pour créer des vidéos avec React et Remotion. Couvre les bonnes pratiques pour les animations, l'audio, les sous-titres et les éléments visuels.