Legacy Documentation: Version 5.0
Animation States
Avatar Mask

Animation Transitions

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Overview

Animation Transitions allow the state machine to switch or blend from one Animation State to another. Transitions define not only how long the blend between states should take, but also under what conditions they should activate. A transition can be set up to only occur when a certain condition is true, and these conditions are based on the values of parameters set up in the Animator Controller.

For example, your character might have a patrolling state and a sleeping state. The transition between patrolling and sleeping could be set up to occur only when an “alertness” parameter value drops below a certain level.

An example of a transition as viewed in the inspector.
An example of a transition as viewed in the inspector.

Transitions can be given a name, by entering text into the field as shown:

This name is then shown in the inspector of the state which uses the transition:

There can be only one transition active at any given time, however the currently active transition can be interrupted by another transition, if the settings have been configured to allow it.

Transition Properties

The following properties can be used to adjust the transition and how it blends between the current and next state (the two states connected by the transition).

Property
Has Exit Time
Settings
Exit Time
Transition Duration
Transition Offset
Interrupt Source
  None
  Current State
  Next State
  Current State then Next State
  Next State then Current State
Ordered Interruption

Transition Graph

The settings listed above can either be adjusted manually by entering numbers into the fields, or the transition diagram can be used, which will modify the values above when the visual elements are manipulated.

The transition settings and graph as shown in the inspector
The transition settings and graph as shown in the inspector

In the above diagram, you can: - Drag the ‘out’ marker to change the duration of the transition. - Drag the ‘in’ marker to change the duration of the transition and the exit time. - Drag the target transition to adjust the transition offset. - Drag the preview playback marker to scrub through the animation blend in the preview window at the bottom of the inspector.

Transitions between blendtree states

If either the current or next state belonging to this transition is a Blend Tree state, the blend tree parameters will appear in the inspector. These values are adjustable, and these are provided as a way to preview how your transition would look with the blendtree values set to different configurations. If your blendtree contains clips of differing lengths, you may want to test what your transition looks in the case when the blendtree is showing the short clip and the case where it’s showing the long clip. Adjusting these values do not affect how the transition behaves at runtime, they are solely for helping you preview how the transition could look in different situations.

The blendtree parameter preview controls, visible when either your current or next state is a blend tree state.
The blendtree parameter preview controls, visible when either your current or next state is a blend tree state.

Conditions

A transition can have a single condition, multiple conditions, or no conditions at all. If your transition has no conditions, only the exit time will be considered. When the exit time is reached, the transition will occur. If your transition has one or more conditions, the conditions must all be met before the transition will be triggered.

A condition consists of:

  • An event parameter, whose value will be considered in the condition.
  • A conditional predicate, if needed (for example Less/Greater for floats).
  • A parameter value (if needed).

If you have “Has Exit Time” selected for the transition and have one or more conditions, the condition(s) will only be checked after the exit time of the state. This allows you to ensure that your transition will only occur during a certain portion of the animation.

Animation States
Avatar Mask