Skip to content

Animation

A model that bends (a character, a flag, a waving Chonky) has a skeleton: bones the mesh is attached to. Move a bone and the mesh around it follows.

An animation clip is one movement of a skeleton over time: a wave, a spin, an idle bob. It stores, for each bone, where it is at each moment. A clip only fits skeletons with the bones it names.

A clip does nothing on its own. What plays it is an animation tree: a small set of states, each playing a clip, with rules for moving between them. Idle until something happens, then wave, then back to idle. A script on the entity drives the tree, telling it which state to be in.

Each one uses the ones to its right.

  • Scripta component on the entitydrives the tree
    • Anim treechonky.anim_treeidle, then wave
      • Clipchonky_idleone state
      • Clipchonky_waveanother state
From a placed entity to movement. The tree has a state per clip; swap the tree and the same model moves differently. (The names are illustrative.)

Some states blend clips instead of playing one: a blend space mixes, say, walk and run by how fast something is going, so the movement changes smoothly rather than switching.

The simplest animation mod swaps a movement the game already has for your own. Your clip is built against the original, so it keeps its skeleton and every bone you didn’t touch keeps the original motion. You can change one bone without redoing the rest.

A model you import from a GLB can bring its own animations. Studio makes the clips, a tree with one state per clip, and a small driver script to put on the entity, all linked up, in one import. See Importing.

Open a clip and it plays on its skeleton in the viewport. The Animation window’s Timeline shows the clip’s keys bone by bone, and Pose the Rig lets you turn bones by hand to check how a model bends.

For programmers

A clip is a Granny track group (per-bone TRS curves) in an .anim.gr2.import, referenced through a thin .animation sidecar that also carries gameplay events. An .anim_tree is a state machine whose states name sidecars (or a blend space); a component script holds a reference to the tree and poses it each frame. Every link in that chain is by ID.

Sound: how the game makes noise.