Overview
The Animator Controller is Unity’s editor-side animation state machine. It stores animation states, transitions, blend trees, and parameters, and works alongside the Animator component on a GameObject. Scripts do not directly play individual clips in most standard workflows; they set parameters, and the Animator Controller decides which state to enter. This makes the Animator Controller a tool page rather than a pure scripting topic. Unity’s more recent animation guidance also places it in a broader production pipeline including clip import, rig choice, blend setup, and optional root motion. (CRE132 Labs, see source-cre132-labs; Unity, The definitive guide to animation in Unity, see source-unity-animation-guide)
Setup
Basic workflow:
- Create an Animator Controller asset in the Project window.
- Assign it to an object’s
Animatorcomponent. - Add animation clips as states.
- Create transitions between states.
- Define parameters such as
IsMoving,Speed, orHit.
Usage
Animator Controller concepts:
| Element | Role |
|---|---|
| State | A node holding an animation clip or blend tree |
| Transition | The rule for moving from one state to another |
| Parameter | A value the controller reads to decide transitions |
| Blend Tree | Blends between clips based on a float parameter |
Typical division of labour:
- the Animator Controller stores animation logic
- unity-animator-scripting sets parameter values from code
For teaching and prototyping, this split is useful because designers can adjust timings and transitions in the editor while programmers expose only a small, readable set of parameters. Unity’s newer designer-focused guidance leans on this division heavily. (Unity, The Unity Game Designer Playbook, see source-unity-game-designer-playbook)
Gotchas
- Too many unnamed transitions become impossible to debug.
- Trigger-heavy setups become fragile if there is no matching transition consuming the trigger.
- Root motion can be powerful, but it changes how movement ownership is divided between animation and gameplay code; teams should decide that boundary deliberately.
- Do not confuse the Animator Controller with general gameplay AI. It is for animation state, not whole-agent decision logic.
Related
unity-animator-scripting · ai-state-machine-pattern · monobehaviour-lifecycle · unity-prefabs · source-cre132-labs · source-unity-animation-guide