Table of Contents

Class AnimationNodeTransition

Namespace
Godot
Assembly
GodotSharp.dll

Simple state machine for cases which don't require a more advanced AnimationNodeStateMachine. Animations can be connected to the inputs and transition times can be specified.

After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its transition_request value to empty.

Note: When using a cross-fade, current_state and current_index change to the next state immediately after the cross-fade begins.

// Play child animation connected to "state_2" port.
  animationTree.Set("parameters/Transition/transition_request", "state_2");

// Get current state name (read-only). animationTree.Get("parameters/Transition/current_state");

// Get current state index (read-only). animationTree.Get("parameters/Transition/current_index");

public class AnimationNodeTransition : AnimationNodeSync, IDisposable
Inheritance
AnimationNodeTransition
Implements
Inherited Members

Constructors

AnimationNodeTransition()

public AnimationNodeTransition()

Properties

AllowTransitionToSelf

If true, allows transition to the self state. When the reset option is enabled in input, the animation is restarted. If false, nothing happens on the transition to the self state.

public bool AllowTransitionToSelf { get; set; }

Property Value

bool

InputCount

The number of enabled input ports for this animation node.

public int InputCount { get; set; }

Property Value

int

XfadeCurve

Determines how cross-fading between animations is eased. If empty, the transition will be linear.

public Curve XfadeCurve { get; set; }

Property Value

Curve

XfadeTime

Cross-fading time (in seconds) between each animation connected to the inputs.

public double XfadeTime { get; set; }

Property Value

double

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

IsInputReset(int)

Returns whether the animation restarts when the animation transitions from the other animation.

public bool IsInputReset(int input)

Parameters

input int

Returns

bool

IsInputSetAsAutoAdvance(int)

Returns true if auto-advance is enabled for the given input index.

public bool IsInputSetAsAutoAdvance(int input)

Parameters

input int

Returns

bool

SetInputAsAutoAdvance(int, bool)

Enables or disables auto-advance for the given input index. If enabled, state changes to the next input after playing the animation once. If enabled for the last input state, it loops to the first.

public void SetInputAsAutoAdvance(int input, bool enable)

Parameters

input int
enable bool

SetInputReset(int, bool)

If true, the destination animation is restarted when the animation transitions.

public void SetInputReset(int input, bool enable)

Parameters

input int
enable bool