Log inGet started

Animation

Animated models in Zero carry named clips (idle, walk, run, …). A clip plays on a skinned body through the AnimGraph — it retargets the clip from its source rig onto the body's rig and drives the…

Playing a clip

The durable way is the ClipPlayer component — attach it to the skinned body and it plays one clip through the AnimGraph:

entity.find("hero").component.add("ClipPlayer", {
    clip = asset.resolve("A_Walk_F_Masc", "animation"),
    looping = true,
})

clip is an AssetRef<animation> (survives renames/moves); looping, speed, and playing control playback. ClipPlayer waits for the body's skeleton to hydrate, so it works on a character spawned from a bundle where the rigged mesh loads a few frames later.

Testing a clip quickly

To eyeball a clip without authoring a component, use the animation toolbox:

animation.play("A_Walk_F_Masc", "hero")                       -- play once, auto-cleanup
animation.play("Idle", "hero", { offset = "5s" })             -- wait 5s, then play
animation.play("Wave", "hero", { loop = true, duration = 8 }) -- loop for 8s

animation.play resolves the clip by identity or name and the entity by id or name, finds the SkinnedModel on it (or under it — the imported-character layout puts the rigged mesh on a child), plays through the AnimGraph, and tears everything down when the window ends. On a body that already animates it overrides for the window and the body's own animation resumes untouched. Playback runs in play mode, like any component-driven animation.

Where animation comes from

Animated content is assets: rigged models with embedded clips, and standalone animation clips you can retarget. Survey what exists with asset.list("animation"), asset.list("bundle"), and the shared library, or generate humanoid animations with the animation service (the generating-assets-and-content guide). asset.inspect on a rigged model shows its clip names.

Going further

For blending, crossfades, and state machines, build on the AnimGraph directly (@builtin::systems.anim.AnimGraphlayoutForEntity, Clip, Mixer, BlendSpace2D, Layer). For full character movement — locomotion blending, turning, jumps — the built-in character controller wires clips to input and physics; inspect it rather than rebuilding that from clips.

  • documentation
  • guide