AnimationNodeStateMachineTransition
A transition within an AnimationNodeStateMachine connecting two AnimationRootNodes.
A transition within an AnimationNodeStateMachine connecting two AnimationRootNodes.
The path generated when using AnimationNodeStateMachinePlayback.Travel is limited to the nodes connected by AnimationNodeStateMachineTransition.
You can set the timing and conditions of the transition in detail.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AnimationNodeStateMachineTransitionConstructor
public AnimationNodeStateMachineTransition();Properties9
AdvanceConditionProperty
public StringName AdvanceCondition { get; set; }Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the AnimationTree that can be controlled from code (see Using AnimationTree). For example, if AnimationTree.TreeRoot is an AnimationNodeStateMachine and AnimationNodeStateMachineTransition.AdvanceCondition is set to "idle":
GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0));AdvanceExpressionProperty
public string AdvanceExpression { get; set; }Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code.
AdvanceModeProperty
public AnimationNodeStateMachineTransition.AdvanceModeEnum AdvanceMode { get; set; }Determines whether the transition should be disabled, enabled when using AnimationNodeStateMachinePlayback.Travel, or traversed automatically if the AnimationNodeStateMachineTransition.AdvanceCondition and AnimationNodeStateMachineTransition.AdvanceExpression checks are true (if assigned).
BreakLoopAtEndProperty
public bool BreakLoopAtEnd { get; set; }If true, breaks the loop at the end of the loop cycle for transition, even if the animation is looping.
PriorityProperty
public int Priority { get; set; }Lower priority transitions are preferred when travelling through the tree via AnimationNodeStateMachinePlayback.Travel or AnimationNodeStateMachineTransition.AdvanceMode is set to AnimationNodeStateMachineTransition.AdvanceModeEnum.Auto.
ResetProperty
public bool Reset { get; set; }If true, the destination animation is played back from the beginning when switched.
SwitchModeProperty
public AnimationNodeStateMachineTransition.SwitchModeEnum SwitchMode { get; set; }The transition type.
XfadeCurveProperty
public Curve XfadeCurve { get; set; }Ease curve for better control over cross-fade between this state and the next. Should be a unit Curve.
XfadeTimeProperty
public float XfadeTime { get; set; }The time to cross-fade between this state and the next.
Note: AnimationNodeStateMachine transitions the current state immediately after the start of the fading. The precise remaining time can only be inferred from the main animation. When AnimationNodeOutput is considered as the most upstream, so the AnimationNodeStateMachineTransition.XfadeTime is not scaled depending on the downstream delta. See also AnimationNodeOneShot.FadeOutTime.
Methods18
GetAdvanceConditionStringName
public StringName GetAdvanceCondition();StringNameGetAdvanceExpressionstring
public string GetAdvanceExpression();stringGetAdvanceModeAnimationNodeStateMachineTransition.AdvanceModeEnum
public AnimationNodeStateMachineTransition.AdvanceModeEnum GetAdvanceMode();AnimationNodeStateMachineTransition.AdvanceModeEnumGetPriorityint
public int GetPriority();intGetSwitchModeAnimationNodeStateMachineTransition.SwitchModeEnum
public AnimationNodeStateMachineTransition.SwitchModeEnum GetSwitchMode();AnimationNodeStateMachineTransition.SwitchModeEnumGetXfadeCurveCurve
public Curve GetXfadeCurve();CurveGetXfadeTimefloat
public float GetXfadeTime();floatIsLoopBrokenAtEndbool
public bool IsLoopBrokenAtEnd();boolIsResetbool
public bool IsReset();boolSetAdvanceConditionvoid
public void SetAdvanceCondition(StringName name);| Name | Type | Default |
|---|---|---|
name | StringName | — |
SetAdvanceExpressionvoid
public void SetAdvanceExpression(string text);| Name | Type | Default |
|---|---|---|
text | string | — |
SetAdvanceModevoid
public void SetAdvanceMode(AnimationNodeStateMachineTransition.AdvanceModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | AnimationNodeStateMachineTransition.AdvanceModeEnum | — |
SetBreakLoopAtEndvoid
public void SetBreakLoopAtEnd(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetPriorityvoid
public void SetPriority(int priority);| Name | Type | Default |
|---|---|---|
priority | int | — |
SetResetvoid
public void SetReset(bool reset);| Name | Type | Default |
|---|---|---|
reset | bool | — |
SetSwitchModevoid
public void SetSwitchMode(AnimationNodeStateMachineTransition.SwitchModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | AnimationNodeStateMachineTransition.SwitchModeEnum | — |
SetXfadeCurvevoid
public void SetXfadeCurve(Curve curve);| Name | Type | Default |
|---|---|---|
curve | Curve | — |
SetXfadeTimevoid
public void SetXfadeTime(float secs);| Name | Type | Default |
|---|---|---|
secs | float | — |
Signals and events1
AdvanceConditionChangedEvent
public event Action AdvanceConditionChanged;Emitted when AnimationNodeStateMachineTransition.AdvanceCondition is changed.
AnimationNodeStateMachineTransition.AdvanceModeEnum
| Value | Description |
|---|---|
Auto = 2 | Automatically use this transition if the |
Disabled = 0 | Don't use this transition. |
Enabled = 1 | Only use this transition during |
AnimationNodeStateMachineTransition.SwitchModeEnum
| Value | Description |
|---|---|
AtEnd = 2 | Wait for the current state playback to end, then switch to the beginning of the next state animation. |
Immediate = 0 | Switch to the next state immediately. The current state will end and blend into the beginning of the new one. |
Sync = 1 | Switch to the next state immediately, but will seek the new state to the playback position of the old state. |