Skills

Bevy Animation

Bevy ECS skill for animation playback.

Install

npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation -g -a claude-code -y
Category
Design
Updated
19d ago
License
LGPL-3.0
Context cost
Mediumabout 1,946 tokens
Runs scripts
No, instructions only

What it does

Bevy ECS skill for animation playback. Keywords: Bevy, AnimationPlayer, AnimationClip, AnimationPlugin, animate_targets.

Bevy animation playback

When to use

Load this when an entity should play an AnimationClip. Blend graphs belong on bevy-animation-graph. 2D sprite specifics belong on bevy-2d-animation.

ECS shape

  • Components: AnimationPlayer controls playback. AnimatedBy links a target entity to the player entity. AnimationTargetId selects which curves apply.
  • Assets: AnimationClip holds VariableCurve entries.
  • Systems: advance_animations advances time. animate_targets writes the curves. AnimationPlugin adds animation support.
  • Events: AnimationEvent can be triggered from a clip. Check the animation docs for observer wiring beyond the trait name.

Playback pieces

NeedBevy idiom
Who advances timeAnimationPlayer on an entity
Clip assetAnimationClip inside an AnimationGraph node
Which bone or fieldAnimationTargetId plus AnimatedBy
RepeatActiveAnimation::repeat, which sets RepeatAnimation::Forever

Examples

[dependencies]
bevy = "0.20"

AnimationPlayer::play takes an AnimationNodeIndex from an AnimationGraph, not a clip handle. AnimationGraph::from_clip builds that one-node graph. AnimatedBy points the target at the player entity. AnimationTargetId::from_name selects the curves for that name.

use bevy::animation::{AnimatedBy, AnimationTargetId};

#[derive(Resource)]
struct WalkNode(AnimationNodeIndex);
Read the whole SKILL.md on GitHub

More in Design