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:

  1. Create an Animator Controller asset in the Project window.
  2. Assign it to an object’s Animator component.
  3. Add animation clips as states.
  4. Create transitions between states.
  5. Define parameters such as IsMoving, Speed, or Hit.

Usage

Animator Controller concepts:

ElementRole
StateA node holding an animation clip or blend tree
TransitionThe rule for moving from one state to another
ParameterA value the controller reads to decide transitions
Blend TreeBlends between clips based on a float parameter

Typical division of labour:

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.

unity-animator-scripting · ai-state-machine-pattern · monobehaviour-lifecycle · unity-prefabs · source-cre132-labs · source-unity-animation-guide