Class reference

AnimationNodeStateMachineTransition

Inherits Resource

A transition within an AnimationNodeStateMachine connecting two AnimationRootNodes.

Description

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.

Properties

StringName 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 AnimationTree.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))
			
			GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0));
			

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

bool break_loop_at_end = false

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

bool reset = true

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

int switch_mode = 0

The transition type.

Curve xfade_curve

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

Signals

Constants

SWITCH_MODE_IMMEDIATE = 0

Enum: SwitchMode

Switch to the next state immediately. The current state will end and blend into the beginning of the new one.

SWITCH_MODE_SYNC = 1

Enum: SwitchMode

Switch to the next state immediately, but will seek the new state to the playback position of the old state.

SWITCH_MODE_AT_END = 2

Enum: SwitchMode

Wait for the current state playback to end, then switch to the beginning of the next state animation.

ADVANCE_MODE_DISABLED = 0

Enum: AdvanceMode

Don't use this transition.

Tutorials

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.