Version: Unity 6.7 Alpha (6000.7)
Language : English
Animator window
State machine basics

Animation state machine

It’s common for a character or a GameObject to have several animations for the different actions it performs in a game. For example, a character might breath and sway slightly when idle, walk when commanded, and raise their arms when they fall from a platform. A sliding door might open, close, or jam.

Mecanim uses a state machine to arrange these actions. A state machine is a graph of nodes and connecting lines that resembles a flowchart. A state machine plays the animation linked to the current action and determines the next action. You can create a state machine for each character and GameObject in your scene.

Topic Description
State machine basics Learn core state machine concepts and build animation flow in the Animator window.
Animation states Configure states, motions, and defaults to control what each state plays.
Animation parametersUsed to communicate between scripting and the Animator Controller. Some parameters can be set in scripting and used by the controller, while other parameters are based on Custom Curves in Animation Clips and can be sampled using the scripting API. More info
See in Glossary
Control state logic with scriptable parameters.
State machine transitions Simplify complex controllers with Entry and Exit transitions between state machines.
Animation transitionsAllows a state machine to switch or blend from one animation state to another. Transitions define how long a blend between states should take, and the conditions that activate them. More info
See in Glossary
Blend between states and define when transitions are triggered.
Animation blend treesUsed for continuous blending between similar Animation Clips based on float Animation Parameters. More info
See in Glossary
Blend similar motions smoothly using parameters and normalized time.
State machine behaviors Attach behavior scripts to states to run code on enter, update, and exit.
Sub-state machines Group related states into nested machines to keep large graphs manageable.
Animation layersAn Animation Layer contains an Animation State Machine that controls animations of a model or part of it. An example of this is if you have a full-body layer for walking or jumping and a higher layer for upper-body motions such as throwing an object or shooting. The higher layers take precedence for the body parts they control. More info
See in Glossary
Separate animation with layered controllers, masks, and blending modes.
State machine solo and mute Preview transitions faster by soloing key paths and muting irrelevant ones.
Target matchingA scripting function that allows you to move characters in such a way that a hand or foot lands in a certain place at a certain time. For example, the character may need to jump across stepping stones or jump and grab an overhead beam. More info
See in Glossary
Match character parts to precise world targets during specific animation windows.

Additional resources

Animator window
State machine basics