Skip to main content
A state is what a state machine layer is doing at a given moment. Most states play a timeline, or blend several timelines together. Transitions move the layer from one state to the next. Every layer has three default states, Entry, Any State, and Exit, and you add the rest:
  • Single plays one timeline.
  • 1D blends timelines based on one value.
  • Additive layers several timelines on top of each other, each with its own amount.

Default states

Every layer starts with an Entry State, an Any State, and an Exit State. The default Entry, Any State, and Exit states in a new layer

Entry State

The Entry State is where the layer starts. When the state machine starts, the layer follows the transition out of the Entry State to its first state. You can connect the Entry State to more than one state, and use conditions to choose which one the layer starts in. For example, a switch can start in its On or Off state depending on a bound value. A switch whose Entry State connects to an On state, which transitions to an Off state

Any State

Transitions out of the Any State can happen from whatever state the layer is in. Use it for states you need to reach from anywhere, such as changing a character’s outfit or setting a rating, without drawing a transition from every other state. A chili pepper rating where the Any State connects to a state for each rating

Exit State

Transitioning to the Exit State stops the layer. It doesn’t just stop the current animation: the layer stops advancing entirely, and its objects stay where the last animation left them. Other layers keep playing. You’ll rarely need it, but it’s useful for a layer that has finished its work, such as an intro that plays once. Stopping the layer saves the work of running it. For example, to play a timeline once and then stop its layer:
1
Put the timeline on its own layer, connected from the Entry State.
2
Add a transition from the timeline’s state to the Exit State.
3
Set the transition’s Exit Time to 100%, so it happens once the timeline has played all the way through.
A layer that has exited can still start again through a transition from the Any State.

Adding a state

  • From a timeline: Drag a timeline from the Animations list onto the graph. This creates a Single state that plays it.
  • Empty: Right-click the graph and choose the type of state to add. Then pick its timelines in the Inspector.
Dragging a timeline from the Animations list onto the graph to create a state To change a state’s type later, select it and change Type in the Inspector. To line up states in the graph, select two or more and use the align and distribute buttons at the top of the Inspector.

Single states

A Single state plays one timeline. Most of a state machine is usually made of Single states. The timeline plays the way it’s set up, as a one-shot, a loop, or a ping-pong. See Animation type. Select a Single state to change its options in the Inspector:
  • Timeline: The timeline the state plays. Type in the dropdown to search for a timeline.
  • Speed: How fast the timeline plays. 1x is normal speed, 2x is twice as fast, and negative values play it backward.

Blend states

A blend state plays multiple timelines at once and mixes them together. Use blend states for anything driven by a changing value, such as a health bar, a loading bar, a scroll position, or a face rig. Blends work best with timelines that key only the properties they need. For example, each timeline in a health bar might key only the bar’s X scale.

1D blend

A 1D blend mixes its timelines based on a single number. Each timeline is set at a value, and as the number moves between two timelines’ values, the blend crossfades between them. For example, a health bar can blend between an Empty timeline at 0 and a Full timeline at 100, driven by a health property. A health bar driven by a 1D blend between an Empty timeline at 0 and a Full timeline at 100
1
Add a state, and set its Type to 1D.
2
Choose the number that drives the blend. Usually this is a view model property.
3
In Timelines, click + to add each timeline, and set the value where it plays at full strength.
The graph above the timelines shows how they mix across the range. While the state machine is playing, a marker moves across it to show the current value.

Capture Base State

Capture Base State is the toggle next to the blend’s property, and it’s on for new 1D blends. When it’s on, the blend starts each frame from the original values of the properties its timelines key, then mixes the timelines on top. This keeps the result the same for any given value. When it’s off, the blend mixes on top of whatever values were already there, so the result can depend on what played before.

Additive blend

An Additive blend plays several timelines on top of each other, each with its own amount from 0 to 100. Use it to combine independent motions, such as mixing smile, frown, and surprise poses on a face. A face rig combining facial expressions with an Additive blend In Timelines, click + and choose how the new timeline’s amount is set:
  • Mix by value: A fixed amount that you set in the Inspector. Use it for a base pose that’s always applied.
  • Mix by view model: The amount comes from a view model property, so your app can change it.
  • Mix by input: The amount comes from a legacy input.

State options

Select a state to see its options in the Inspector:
  • Name: The state’s name.
  • Caption: A note for collaborators or your future self. See Captions.
  • Type: Single, 1D, or Additive.
  • Transitions: The transitions leaving the state. Click the eye icon to disable one, or - to remove it.
  • Randomize Exit: Picks one of the state’s transitions at random, weighted by a Factor you set on each one. See Randomize exit.
Single states also have Timeline and Speed, and blend states have their blend settings.

Captions

When a state has a caption, an info icon appears on it in the graph. Hover over the icon to read the caption. Use captions to explain why a state exists or how complex logic works. Captions are only visible in the editor, and aren’t exported.

Actions

A state can run actions when it starts or ends, such as setting a view model property, reporting an event, or moving focus. Select the state, then click + next to its name in the panel below the graph.

Common issues

Example: a simple button

This video builds a button with two layers of interactivity, hover and click.