summaryrefslogtreecommitdiff
path: root/doc/classes/AnimationNodeTransition.xml
diff options
context:
space:
mode:
authorSilc Renew <tokage.it.lab@gmail.com>2023-02-13 14:16:40 +0900
committerSilc Renew <tokage.it.lab@gmail.com>2023-02-13 14:16:40 +0900
commit045c8845c7bccace4e5ed75d9d47ac2f8a32f889 (patch)
tree7a915323566444d35184e58ce95bb2b28ede854a /doc/classes/AnimationNodeTransition.xml
parent27b2260460ab478707d884a16429add5bb3375f1 (diff)
Add document about animation read-only props and state length
Diffstat (limited to 'doc/classes/AnimationNodeTransition.xml')
-rw-r--r--doc/classes/AnimationNodeTransition.xml9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/classes/AnimationNodeTransition.xml b/doc/classes/AnimationNodeTransition.xml
index 7e4d87bd2c..4eeaf15b53 100644
--- a/doc/classes/AnimationNodeTransition.xml
+++ b/doc/classes/AnimationNodeTransition.xml
@@ -6,6 +6,7 @@
<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.
+ [b]Note:[/b] When using a cross-fade, [code]current_state[/code] and [code]current_index[/code] change to the next state immediately after the cross-fade begins.
[codeblocks]
[gdscript]
# Play child animation connected to "state_2" port.
@@ -13,12 +14,12 @@
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/transition_request"] = "state_2"
- # Get current state name.
+ # Get current state name (read-only).
animation_tree.get("parameters/Transition/current_state")
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/current_state"]
- # Get current state index.
+ # Get current state index (read-only).
animation_tree.get("parameters/Transition/current_index"))
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/current_index"]
@@ -27,10 +28,10 @@
// Play child animation connected to "state_2" port.
animationTree.Set("parameters/Transition/transition_request", "state_2");
- // Get current state name.
+ // Get current state name (read-only).
animationTree.Get("parameters/Transition/current_state");
- // Get current state index.
+ // Get current state index (read-only).
animationTree.Get("parameters/Transition/current_index");
[/csharp]
[/codeblocks]