Table of Contents

Class AnimationNodeStateMachineTransition

A transition within an AnimationNodeStateMachine connecting two AnimationRootNodes.

Inheritance
AnimationNodeStateMachineTransition

Remarks

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.

See Also

Properties

advance_condition

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 tree_root is an AnimationNodeStateMachine and advance_condition is set to "idle":

$animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))

var advance_condition : StringName = &""

Property Value

StringName

Remarks

advance_expression

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.

var advance_expression : String = ""

Property Value

String

Remarks

  • void set_advance_expression(String value)
  • String get_advance_expression

advance_mode

Determines whether the transition should be disabled, enabled when using AnimationNodeStateMachinePlayback.travel, or traversed automatically if the advance_condition and advance_expression checks are true (if assigned).

var advance_mode : int = 1

Property Value

int

Remarks

  • void set_advance_mode(int value)
  • int get_advance_mode

break_loop_at_end

If true, breaks the loop at the end of the loop cycle for transition, even if the animation is looping.

var break_loop_at_end : bool = false

Property Value

bool

Remarks

  • void set_break_loop_at_end(bool value)
  • bool is_loop_broken_at_end

priority

Lower priority transitions are preferred when travelling through the tree via AnimationNodeStateMachinePlayback.travel or advance_mode is set to AnimationNodeStateMachineTransition.ADVANCE_MODE_AUTO.

var priority : int = 1

Property Value

int

Remarks

  • void set_priority(int value)
  • int get_priority

reset

If true, the destination animation is played back from the beginning when switched.

var reset : bool = true

Property Value

bool

Remarks

  • void set_reset(bool value)
  • bool is_reset

switch_mode

The transition type.

var switch_mode : int = 0

Property Value

int

Remarks

  • void set_switch_mode(int value)
  • int get_switch_mode

xfade_curve

Ease curve for better control over cross-fade between this state and the next. Should be a unit Curve.

var xfade_curve : Curve

Property Value

Curve

Remarks

  • void set_xfade_curve(Curve value)
  • Curve get_xfade_curve

xfade_time

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 xfade_time is not scaled depending on the downstream delta. See also fadeout_time.

var xfade_time : float = 0.0

Property Value

float

Remarks

  • void set_xfade_time(float value)
  • float get_xfade_time

Events

advance_condition_changed

Emitted when advance_condition is changed.

signal advance_condition_changed