Transition Rules

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 or not.

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, in order 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 as well:

RulesBothWays.png

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

Editing Transition Rules

Double-clicking on 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) in order for the transition to occur.

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

Transition Rules Details

When Left-clicking on the 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 precedent.
Bidirectional Determines if the transition can go both directions.
Blend Logic Specifies what transition logic to use: Standard Blend or Custom Blend . Selecting Custom will enable you to enter the Blend Graph to set a custom Blend Transition.
Transition Rule Sharing This option allows you to set whether or not the rule can be shared with other transitions or 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 Interrupt Set the Trigger Weight Threshold and specify a Notify State Class.
Transition Crossfade Sharing Use an existing Transition Crossfade Blend or promote the existing Transition Crossfade to shared.
Duration The duration to apply to the cross-fade.
Mode The type of blending applied to the cross-fade. 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.
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.

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 type of nodes correctly responds 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.

Custom Blend Nodes

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 of 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.