AnimationNodeStateMachineTransition

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvanceMode

type AdvanceMode int //gd:AnimationNodeStateMachineTransition.AdvanceMode
const (
	// Don't use this transition.
	AdvanceModeDisabled AdvanceMode = 0
	// Only use this transition during [AnimationNodeStateMachinePlayback.Travel].
	//
	// [AnimationNodeStateMachinePlayback.Travel]: https://pkg.go.dev/graphics.gd/classdb/AnimationNodeStateMachinePlayback#Instance.Travel
	AdvanceModeEnabled AdvanceMode = 1
	// Automatically use this transition if the [AdvanceCondition] and [AdvanceExpression] checks are true (if assigned).
	//
	// [AdvanceCondition]: https://pkg.go.dev/graphics.gd/classdb/#Instance.AdvanceCondition
	// [AdvanceExpression]: https://pkg.go.dev/graphics.gd/classdb/#Instance.AdvanceExpression
	AdvanceModeAuto AdvanceMode = 2
)

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsAnimationNodeStateMachineTransition() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsAnimationNodeStateMachineTransition

func (self *Extension[T]) AsAnimationNodeStateMachineTransition() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AdvanceCondition

func (self Instance) AdvanceCondition() string

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 AdvanceCondition is set to "idle":

func (Instance) AdvanceExpression

func (self Instance) AdvanceExpression() string

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.

func (Instance) AdvanceMode

func (self Instance) AdvanceMode() AdvanceMode

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

func (Instance) AsAnimationNodeStateMachineTransition

func (self Instance) AsAnimationNodeStateMachineTransition() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) BreakLoopAtEnd

func (self Instance) BreakLoopAtEnd() bool

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

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnAdvanceConditionChanged

func (self Instance) OnAdvanceConditionChanged(cb func(), flags ...Signal.Flags)

Emitted when AdvanceCondition is changed.

func (Instance) Priority

func (self Instance) Priority() int

Lower priority transitions are preferred when travelling through the tree via AnimationNodeStateMachinePlayback.Travel or AdvanceMode is set to AdvanceModeAuto.

func (Instance) Reset

func (self Instance) Reset() bool

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

func (Instance) SetAdvanceCondition

func (self Instance) SetAdvanceCondition(value string)

SetAdvanceCondition sets the property returned by [GetAdvanceCondition].

func (Instance) SetAdvanceExpression

func (self Instance) SetAdvanceExpression(value string)

SetAdvanceExpression sets the property returned by [GetAdvanceExpression].

func (Instance) SetAdvanceMode

func (self Instance) SetAdvanceMode(value AdvanceMode)

SetAdvanceMode sets the property returned by [GetAdvanceMode].

func (Instance) SetBreakLoopAtEnd

func (self Instance) SetBreakLoopAtEnd(value bool)

SetBreakLoopAtEnd sets the property returned by [IsLoopBrokenAtEnd].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetPriority

func (self Instance) SetPriority(value int)

SetPriority sets the property returned by [GetPriority].

func (Instance) SetReset

func (self Instance) SetReset(value bool)

SetReset sets the property returned by [IsReset].

func (Instance) SetSwitchMode

func (self Instance) SetSwitchMode(value SwitchMode)

SetSwitchMode sets the property returned by [GetSwitchMode].

func (Instance) SetXfadeCurve

func (self Instance) SetXfadeCurve(value Curve.Instance)

SetXfadeCurve sets the property returned by [GetXfadeCurve].

func (Instance) SetXfadeTime

func (self Instance) SetXfadeTime(value Float.X)

SetXfadeTime sets the property returned by [GetXfadeTime].

func (Instance) SwitchMode

func (self Instance) SwitchMode() SwitchMode

The transition type.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) XfadeCurve

func (self Instance) XfadeCurve() Curve.Instance

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

func (Instance) XfadeTime

func (self Instance) XfadeTime() Float.X

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 XfadeTime is not scaled depending on the downstream delta. See also AnimationNodeOneShot.FadeoutTime.

type SwitchMode

type SwitchMode int //gd:AnimationNodeStateMachineTransition.SwitchMode
const (
	// Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
	SwitchModeImmediate SwitchMode = 0
	// Switch to the next state immediately, but will seek the new state to the playback position of the old state.
	SwitchModeSync SwitchMode = 1
	// Wait for the current state playback to end, then switch to the beginning of the next state animation.
	SwitchModeAtEnd SwitchMode = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL