123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/AnimationNodeStateMachineTransition.xml.
- .. _class_AnimationNodeStateMachineTransition:
- AnimationNodeStateMachineTransition
- ===================================
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- A transition within an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` connecting two :ref:`AnimationRootNode<class_AnimationRootNode>`\ s.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- The path generated when using :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` is limited to the nodes connected by **AnimationNodeStateMachineTransition**.
- You can set the timing and conditions of the transition in detail.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`String<class_String>` | :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` | ``""`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` | :ref:`advance_mode<class_AnimationNodeStateMachineTransition_property_advance_mode>` | ``1`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`bool<class_bool>` | :ref:`reset<class_AnimationNodeStateMachineTransition_property_reset>` | ``true`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeStateMachineTransition_property_xfade_curve>` | |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- | :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
- +--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------+----------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Signals
- -------
- .. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
- .. rst-class:: classref-signal
- **advance_condition_changed** **(** **)**
- Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_AnimationNodeStateMachineTransition_SwitchMode:
- .. rst-class:: classref-enumeration
- enum **SwitchMode**:
- .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
- .. rst-class:: classref-enumeration-constant
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_IMMEDIATE** = ``0``
- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
- .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
- .. rst-class:: classref-enumeration-constant
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_SYNC** = ``1``
- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
- .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
- .. rst-class:: classref-enumeration-constant
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **SWITCH_MODE_AT_END** = ``2``
- Wait for the current state playback to end, then switch to the beginning of the next state animation.
- .. rst-class:: classref-item-separator
- ----
- .. _enum_AnimationNodeStateMachineTransition_AdvanceMode:
- .. rst-class:: classref-enumeration
- enum **AdvanceMode**:
- .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_DISABLED:
- .. rst-class:: classref-enumeration-constant
- :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_DISABLED** = ``0``
- Don't use this transition.
- .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_ENABLED:
- .. rst-class:: classref-enumeration-constant
- :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_ENABLED** = ``1``
- Only use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>`.
- .. _class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_AUTO:
- .. rst-class:: classref-enumeration-constant
- :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **ADVANCE_MODE_AUTO** = ``2``
- Automatically use this transition if the :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` and :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` checks are true (if assigned).
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_AnimationNodeStateMachineTransition_property_advance_condition:
- .. rst-class:: classref-property
- :ref:`StringName<class_StringName>` **advance_condition** = ``&""``
- .. rst-class:: classref-property-setget
- - void **set_advance_condition** **(** :ref:`StringName<class_StringName>` value **)**
- - :ref:`StringName<class_StringName>` **get_advance_condition** **(** **)**
- Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree<class_AnimationTree>` that can be controlled from code (see `Using AnimationTree <../tutorials/animation/animation_tree.html#controlling-from-code>`__). For example, if :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>` is an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` and :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is set to ``"idle"``:
- .. tabs::
- .. code-tab:: gdscript
- $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
- .. code-tab:: csharp
- GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0));
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_advance_expression:
- .. rst-class:: classref-property
- :ref:`String<class_String>` **advance_expression** = ``""``
- .. rst-class:: classref-property-setget
- - void **set_advance_expression** **(** :ref:`String<class_String>` value **)**
- - :ref:`String<class_String>` **get_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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_advance_mode:
- .. rst-class:: classref-property
- :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **advance_mode** = ``1``
- .. rst-class:: classref-property-setget
- - void **set_advance_mode** **(** :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` value **)**
- - :ref:`AdvanceMode<enum_AnimationNodeStateMachineTransition_AdvanceMode>` **get_advance_mode** **(** **)**
- Determines whether the transition should disabled, enabled when using :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>`, or traversed automatically if the :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` and :ref:`advance_expression<class_AnimationNodeStateMachineTransition_property_advance_expression>` checks are true (if assigned).
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_priority:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **priority** = ``1``
- .. rst-class:: classref-property-setget
- - void **set_priority** **(** :ref:`int<class_int>` value **)**
- - :ref:`int<class_int>` **get_priority** **(** **)**
- Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`advance_mode<class_AnimationNodeStateMachineTransition_property_advance_mode>` is set to :ref:`ADVANCE_MODE_AUTO<class_AnimationNodeStateMachineTransition_constant_ADVANCE_MODE_AUTO>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_reset:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **reset** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_reset** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_reset** **(** **)**
- If ``true``, the destination animation is played back from the beginning when switched.
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_switch_mode:
- .. rst-class:: classref-property
- :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_switch_mode** **(** :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` value **)**
- - :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **get_switch_mode** **(** **)**
- The transition type.
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_xfade_curve:
- .. rst-class:: classref-property
- :ref:`Curve<class_Curve>` **xfade_curve**
- .. rst-class:: classref-property-setget
- - void **set_xfade_curve** **(** :ref:`Curve<class_Curve>` value **)**
- - :ref:`Curve<class_Curve>` **get_xfade_curve** **(** **)**
- Ease curve for better control over cross-fade between this state and the next.
- .. rst-class:: classref-item-separator
- ----
- .. _class_AnimationNodeStateMachineTransition_property_xfade_time:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **xfade_time** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_xfade_time** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_xfade_time** **(** **)**
- The time to cross-fade between this state and the next.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|