Transition Types

Each of the State types that are included in Animancer has its own Transition type which contains various details relevant to it so that when passed into AnimancerComponent.Play(ITransition) it will create that type of state. For example, a ClipState.Transition will create a ClipState to play a single AnimationClip.

Unfortunately, the tool used to generate this site (Wyam 2.2.9) does not currently support nested types with identical names so their API documentation has not been generated properly.

Transition Assets

Each transition type also has an associated ScriptableObject type with a transition field (and nothing else) so that you can create them as assets to share a transition throughout your project instead of each object having its own individual transition. They all follow the same naming convention:

Class Description
ClipState The most common type of State. Manages the runtime details of an AnimationClip such as its Time, Speed, Events, etc.
ClipState.Transition A serializable class which allows the above details to be defined in the Inspector and will create a ClipState when played (see Transitions for more information).
ClipTransition A transition asset which has a ClipState.Transition field.
  • You can create transition assets using functions in the Assets/Create/Animancer menu.
  • The Transition.State property normally gives you access to the state created by the transition, but it is important to be aware that since transition assets are often used by multiple objects that property will only hold a reference to the most recently played state.
  • The Linear Blending example demonstrates how to use them.
Regular Transition Transition Asset
using Animancer;
using UnityEngine;

public class TransitionExample : MonoBehaviour
{
    [SerializeField] 
    private ClipState.Transition _Animation;
}
using Animancer;
using UnityEngine;

public class TransitionExample : MonoBehaviour
{
    [SerializeField] 
    private ClipTransition _Animation;
}
When you use a regular transition field, it is a part of the script where is it declared so every instance of that script will have its own transition details.

When you use a transition asset, you need to actually create a separate asset for your field to reference, but then anything in your project can reference that asset to use the exact same transition settings.

Normally when referencing another object like this you need to select that object to view or edit its values, but if you have Inspector Gadgets Pro it shows a foldout arrow on the Object Field so that you can show the referenced object's Inspector without changing your selection.

Basic Transitions

Type Details
AnimancerState
.Transition<TState>
abstract base class for all other transitions. Only has a FadeDuration field.
ClipState
.Transition

Inherits from AnimancerState.Transition<ClipState> and will create a ClipState. The details of each field are explained on the Transitions page.

PlayableAssetState
.Transition

Inherits from AnimancerState.Transition<PlayableAssetState> and will create a PlayableAssetState. Generally used with Timeline assets. Has similar fields to a ClipState.Transition.

Mixer Transitions

These transitions create various types of Mixer States. They all use reorderable lists to configure their states. You can Right Click on any of the transition fields to open a context menu with several useful functions.

Type Details
ManualMixerState
.Transition<TMixer>
abstract base class for transitions that create states derived from ManualMixerState.
ManualMixerState
.Transition

Inherits from ManualMixerState.Transition<ManualMixerState> and will create a base ManualMixerState.

MixerState
.Transition<TMixer, TParameter>
abstract base class for transitions that create states derived from MixerState. Has a Thresholds array and DefaultParameter field.
LinearMixerState
.Transition

Inherits from MixerState.Transition<LinearMixerState,float> and will create a LinearMixerState.

MixerState
.Transition2D

Inherits from MixerState.Transition<MixerState<Vector2>,Vector2> and will create either a CartesianMixerState or DirectionalMixerState depending on the selected Type.

Controller Transitions

These transitions create various types of Controller States.

Type Details
ControllerState
.Transition<TState>
abstract base class for transitions that create states derived from ControllerState.
ControllerState
.Transition

Inherits from ControllerState.Transition<ControllerState> and will create a base ControllerState.

Float1ControllerState
.Transition

Float2ControllerState
.Transition

Float3ControllerState
.Transition

Inherits from ControllerState.Transition<Float1ControllerState> and adds a ParameterName field and will create a Float1ControllerState which wraps that particular parameter. Once an Animator Controller is assigned, the Parameter Name field allows you to select the name of any Float parameter.

Custom Transitions

You can create your own transitions by implementing ITransition from scratch or inheriting from AnimancerState.Transition or any of its derived types. When doing so, you may also want to alter the way it is drawn in the Inspector by creating another class that inherits from the Drawer class inside the Transition you are inheriting from or implementing your own PropertyDrawer.

The Root Motion example implements a class that inherits from ClipState.Transition to add an ApplyRootMotion field to determine whether the Animator.applyRootMotion should be enabled for each animation.