summaryrefslogtreecommitdiff
path: root/doc/classes/AnimationNodeTransition.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/AnimationNodeTransition.xml')
-rw-r--r--doc/classes/AnimationNodeTransition.xml29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml
index bc3e5716dd..7e4d87bd2c 100644
--- a/doc/classes/AnimationNodeTransition.xml
+++ b/doc/classes/AnimationNodeTransition.xml
@@ -5,6 +5,35 @@
</brief_description>
<description>
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 [code]transition_request[/code] value to empty.
+ [codeblocks]
+ [gdscript]
+ # Play child animation connected to "state_2" port.
+ animation_tree.set("parameters/Transition/transition_request", "state_2")
+ # Alternative syntax (same result as above).
+ animation_tree["parameters/Transition/transition_request"] = "state_2"
+
+ # Get current state name.
+ animation_tree.get("parameters/Transition/current_state")
+ # Alternative syntax (same result as above).
+ animation_tree["parameters/Transition/current_state"]
+
+ # Get current state index.
+ animation_tree.get("parameters/Transition/current_index"))
+ # Alternative syntax (same result as above).
+ animation_tree["parameters/Transition/current_index"]
+ [/gdscript]
+ [csharp]
+ // Play child animation connected to "state_2" port.
+ animationTree.Set("parameters/Transition/transition_request", "state_2");
+
+ // Get current state name.
+ animationTree.Get("parameters/Transition/current_state");
+
+ // Get current state index.
+ animationTree.Get("parameters/Transition/current_index");
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="AnimationTree">$DOCS_URL/tutorials/animation/animation_tree.html</link>