Table of Contents

Class AnimationNodeOneShot

Namespace
Godot
Assembly
GodotSharp.dll

A resource to add to an AnimationNodeBlendTree. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.

After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its request value to None.

// Play child animation connected to "shot" port.
  animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire);

// Abort child animation connected to "shot" port. animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort);

// Abort child animation with fading out connected to "shot" port. animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut);

// Get current state (read-only). animationTree.Get("parameters/OneShot/active");

// Get current internal state (read-only). animationTree.Get("parameters/OneShot/internal_active");

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

Constructors

AnimationNodeOneShot()

public AnimationNodeOneShot()

Properties

Autorestart

If true, the sub-animation will restart automatically after finishing.

In other words, to start auto restarting, the animation must be played once with the Fire request. The Abort request stops the auto restarting, but it does not disable the Autorestart itself. So, the Fire request will start auto restarting again.

public bool Autorestart { get; set; }

Property Value

bool

AutorestartDelay

The delay after which the automatic restart is triggered, in seconds.

public double AutorestartDelay { get; set; }

Property Value

double

AutorestartRandomDelay

If Autorestart is true, a random additional delay (in seconds) between 0 and this value will be added to AutorestartDelay.

public double AutorestartRandomDelay { get; set; }

Property Value

double

FadeInCurve

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

public Curve FadeInCurve { get; set; }

Property Value

Curve

FadeInTime

The fade-in duration. For example, setting this to 1.0 for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation.

public double FadeInTime { get; set; }

Property Value

double

FadeOutCurve

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

public Curve FadeOutCurve { get; set; }

Property Value

Curve

FadeOutTime

The fade-out duration. For example, setting this to 1.0 for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation.

public double FadeOutTime { get; set; }

Property Value

double

MixMode

The blend type.

public AnimationNodeOneShot.MixModeEnum MixMode { get; set; }

Property Value

AnimationNodeOneShot.MixModeEnum

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