
Bevy Animation Graph
Bevy ECS skill for animation blending.
Install
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-animation-graph -g -a claude-code -y- Repository
- thedivergentai/Game-Dev-Agentic-Skills917
- Category
- Design
- Updated
- 19d ago
- License
- LGPL-3.0
- Context cost
- Mediumabout 2,093 tokens
- Runs scripts
- No, instructions only
What it does
Bevy ECS skill for animation blending. Keywords: Bevy, AnimationGraph, blend, AnimationGraphHandle, AnimationNodeType.
Bevy animation graph
When to use
Load this when clips must blend, add, or mask. Single-clip playback stays on bevy-animation.
ECS shape
- Assets:
AnimationGraphdescribes how clips blend.add_clipparents a clip node.add_blendparents a blend node.add_clip_with_maskstores au64mask (bone groups you assign;0means no mask). - Components:
AnimationGraphHandleis a handle to the graph used by theAnimationPlayeron the same entity.AnimationTransitionscrossfades between nodes. - Weights:
ActiveAnimation::set_weighton the player, afterplay, drives a node that is already in the graph. - Systems: evaluation still runs through the animation player systems. Do not add a second player.
#[derive(Resource)]
struct LocomotionNodes {
graph: Handle<AnimationGraph>,
walk: AnimationNodeIndex,
run: AnimationNodeIndex,
}
fn build_locomotion_graph(
mut commands: Commands,
asset_server: Res<AssetServer>,
mut graphs: ResMut<Assets<AnimationGraph>>,
) {
let mut graph = AnimationGraph::new();
let blend = graph.add_blend(0.5, graph.root);
let walk = graph.add_clip(
asset_server.load(GltfAssetLabel::Animation(0).from_asset("models/fox.glb")),
1.0,
blend,
);
let run = graph.add_clip_with_mask(
asset_server.load(GltfAssetLabel::Animation(1).from_asset("models/fox.glb")),
0b0011,
1.0,
blend,
);
let handle = graphs.add(graph);
commands.insert_resource(LocomotionNodes {
graph: handle,
walk,
run,
});
}
#[derive(Resource)]
struct LocomotionNodes {
graph: Handle<AnimationGraph>,
walk: AnimationNodeIndex,
run: AnimationNodeIndex,
}


