summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-04-20 20:05:08 +0200
committerGitHub <noreply@github.com>2021-04-20 20:05:08 +0200
commit399f55751e54fb144db4da02a5e5b023fea41d34 (patch)
tree7cdd206c9671bc7f8b9bb4d487e793d01f2ba4be /doc
parent0c995a979011e4dcb6cf99f5096da6f144226602 (diff)
parent35c9192689216e61c7425a8ab962a0fe4dfdf58d (diff)
Merge pull request #47983 from smix8/doc_animationnodetimeseek
Document AnimationNodeTimeSeek with clarified usage and code example
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/AnimationNodeTimeSeek.xml22
1 files changed, 21 insertions, 1 deletions
diff --git a/doc/classes/AnimationNodeTimeSeek.xml b/doc/classes/AnimationNodeTimeSeek.xml
index eb5335c792..171d65fbe0 100644
--- a/doc/classes/AnimationNodeTimeSeek.xml
+++ b/doc/classes/AnimationNodeTimeSeek.xml
@@ -4,7 +4,27 @@
A time-seeking animation node to be used with [AnimationTree].
</brief_description>
<description>
- This node can be used to cause a seek command to happen to any sub-children of the graph. After setting the time, this value returns to -1.
+ This node can be used to cause a seek command to happen to any sub-children of the animation graph. Use this node type to play an [Animation] from the start or a certain playback position inside the [AnimationNodeBlendTree]. After setting the time and changing the animation playback, the seek node automatically goes into sleep mode on the next process frame by setting its [code]seek_position[/code] value to [code]-1.0[/code].
+ [codeblocks]
+ [gdscript]
+ # Play child animation from the start.
+ animation_tree.set("parameters/Seek/seek_position", 0.0)
+ # Alternative syntax (same result as above).
+ animation_tree["parameters/Seek/seek_position"] = 0.0
+
+ # Play child animation from 12 second timestamp.
+ animation_tree.set("parameters/Seek/seek_position", 12.0)
+ # Alternative syntax (same result as above).
+ animation_tree["parameters/Seek/seek_position"] = 12.0
+ [/gdscript]
+ [csharp]
+ // Play child animation from the start.
+ animationTree.Set("parameters/Seek/seek_position", 0.0);
+
+ // Play child animation from 12 second timestamp.
+ animationTree.Set("parameters/Seek/seek_position", 12.0);
+ [/csharp]
+ [/codeblocks]
</description>
<tutorials>
<link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link>