Transition Rules

Guide to rules that govern State Machine Transitions

Choose your operating system:

Windows

macOS

Linux

Creating Transition Rules

Transition Rules are methods of controlling flow inside a State Machine , and are automatically created along the wires that connect States and Conduits . These Transition Rules can perform any number of checks and tests against variable values, all with the purpose of outputting a true or false value, which then determines whether the animation can move through the transition.

Connecting States or Conduits together can be performed by left-clicking and dragging from one State (or Conduit) to another:

ConnectStates.png

After a connection is made, a Transition Rule appears as a small circular directional icon inside the wired connection:

TransitionRule.png

When you mouse over the icon, a visual indication of what the rule is will be displayed:

TransitionRuleMouseOver.png

In this example, for JumpLoop to transition to JumpEnd , the variable IsInAir? must be NOT true.

Rules can also be set to determine flow for a transition in both directions:

RulesBothWays.png

This means that a rule can be set to exit one state then to move to another, and a rule can be applied to transition back to that state.

Editing Transition Rules

Double-clicking a Transition Rule will open a window where you can define the variables that must be met for the transition to occur.

EditRule.png

Similar to Blueprints , you can specify variables in the My Blueprint window and drag them into the graph. By connecting the variables to various conditions which are then connected to the Result node, you can define what must be true (or false ) for the transition to occur.

For information on getting started with Blueprint, refer to the Introduction to Blueprints documentation.

Transition Rule Details

When you click a Transition Rule , the Details panel will update, and additional options will become available.

TransitionDetails.png

Property

Description

Transition Priority Order

The priority order of the transition. If multiple transitions out of a state are true at the same time, the one with the lowest number for priority order will take precedence.

Bidirectional

Determines if the transition can go both directions.

Blend Logic

Specifies what transition logic to use: Standard Blend, Inertialization , or Custom Blend .

Transition Rule Sharing

Use this option to set whether or not the rule can be shared with other transitions, or whether to use the rule from another transition.

Automatic Rule Based on Sequence Player in State

This will try to set the rule automatically, based on most relevant player node's remaining time and the Crossfade Duration of the transition, ignoring the internal time.

Transition Crossfade Sharing

Use an existing Transition Crossfade Blend, or promote the existing Transition Crossfade to shared.

Duration

The duration to apply to the crossfade.

Mode

The type of blending applied to the crossfade. See Animation Blend Modes for more information.

Custom Blend Curve

Takes in a user-specified blend curve and applies it during the blend.

Blend Profile

The blend profile used to evaluate this transition per bone.

Transition Interrupt

Set the Trigger Weight Threshold and specify a Notify State Class.

Start Transition Event / Custom Blueprint Event

Call and execute an Event from within the notified Blueprint at the start of the transition.

End Transition Event / Custom Blueprint Event

Call and execute an Event from within the notified Blueprint at the end of the transition.

Interrupt Transition Event / Custom Blueprint Event

Call and execute an Event from within the notified Blueprint when the transition is interrupted.

Inertialization

Inertial blending is a type of blend; however, the Inertialization system itself does not sample from a source animation. Instead, the velocity and acceleration that are inherent in the motion at the time we begin the switch to the new animation are used to carry forward the motion.

Please see Inertialization for more information on Inertialization usage.

You can enable Inertialization by setting the Blend Logic property in the Details panel to Inertialization .

StateMachine_Transition.png

You can also set the Transition Type to Inertialization on certain Blend Nodes .

You will need to use the Inertialization node to specify where in your AnimGraph the inertial blend is to occur.

InertialBlendAnimGraph.png

The video below illustrates a Standard Blend as well as an Inertial Blend (the playback speed has been altered to illustrate the transition).

In the video above, we use a Standard Blend to blend between animations. Both animations are sampled at the same time and crossfade during the transition.

When we apply Inertialization as the Blend Logic, we add the Inertialization node between the Locomotion and the final output pose. When doing so, the transitions between states are instantaneous, and the motion carries over to the next pose.

Custom Blends

In addition to the nodes cited above, there is also information exposed inside Custom Blend Graphs to allow them to be used for more than just a one-shot, custom-transition animation.

CustomBlendNodes.png

No.

Node

Description

1

State Weight

Gets the blend weight of a specified state.

2

Get Transition Time Elapsed

Gets the elapsed time in seconds of a specified transition.

3

Get Transition Time Elapsed (ratio)

Gets the elapsed time as a fraction of the crossfade duration for a specified transition.

4

Get Transition Crossfade Duration

Gets the crossfade duration of a specified transition.

You can also use get nodes that reference the asset players just like a Transition Rule.

If you have an understanding of Animation Programming in Unreal, Native Getters can also be used to improve performance.

Additional Considerations

When working with child Animation Blueprints and overriding animations in a State Machine, animations referenced by transition rules do not have to be the same length in every child Animation Blueprint. When using nodes like the Time Remaining node (which can be used to determine how much time is remaining in an animation and can be used as part of a Transition Rule), these types of nodes correctly respond to changes in animation length when animations are overridden in child Animation Blueprints.

Also, rather than targeting a specific animation as part of your Transition Rule that might change or may be overridden, you can use several class-based get nodes that always pick the highest weighted animation from the source state (pictured below).

GetRelevantNodes.png

No.

Node

Description

1

Get Relevant Anim Length (Movement)

Gets the length in seconds of the most relevant animation in the source state.

2

Get Relevant Anim Time (Movement)

Gets the current accumulated time in seconds for the most relevant animation in the source state.

3

Get Relevant Anim Time Fraction (Movement)

Gets the current accumulated time as a fraction of the length of the most relevant animation in the source state.

4

Get Relevant Anim Time Remaining (Movement)

Gets the time remaining in seconds for the most relevant animation in the source state.

5

Get Relevant Anim Time Remaining Fraction (Movement)

Gets the time remaining as a fraction of the duration for the most relevant animation in the source state.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss