class_animationnodetimeseek.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AnimationNodeTimeSeek.xml.
  6. .. _class_AnimationNodeTimeSeek:
  7. AnimationNodeTimeSeek
  8. =====================
  9. **Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A time-seeking animation node to be used with :ref:`AnimationTree<class_AnimationTree>`.
  11. Description
  12. -----------
  13. 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 :ref:`Animation<class_Animation>` from the start or a certain playback position inside the :ref:`AnimationNodeBlendTree<class_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 ``seek_position`` value to ``-1.0``.
  14. .. tabs::
  15. .. code-tab:: gdscript
  16. # Play child animation from the start.
  17. animation_tree.set("parameters/Seek/seek_position", 0.0)
  18. # Alternative syntax (same result as above).
  19. animation_tree["parameters/Seek/seek_position"] = 0.0
  20. # Play child animation from 12 second timestamp.
  21. animation_tree.set("parameters/Seek/seek_position", 12.0)
  22. # Alternative syntax (same result as above).
  23. animation_tree["parameters/Seek/seek_position"] = 12.0
  24. .. code-tab:: csharp
  25. // Play child animation from the start.
  26. animationTree.Set("parameters/Seek/seek_position", 0.0);
  27. // Play child animation from 12 second timestamp.
  28. animationTree.Set("parameters/Seek/seek_position", 12.0);
  29. Tutorials
  30. ---------
  31. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  32. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  33. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  34. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  35. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  36. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  37. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`