class_animationnodetimeseek.rst 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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``.
  15. .. tabs::
  16. .. code-tab:: gdscript
  17. # Play child animation from the start.
  18. animation_tree.set("parameters/Seek/seek_position", 0.0)
  19. # Alternative syntax (same result as above).
  20. animation_tree["parameters/Seek/seek_position"] = 0.0
  21. # Play child animation from 12 second timestamp.
  22. animation_tree.set("parameters/Seek/seek_position", 12.0)
  23. # Alternative syntax (same result as above).
  24. animation_tree["parameters/Seek/seek_position"] = 12.0
  25. .. code-tab:: csharp
  26. // Play child animation from the start.
  27. animationTree.Set("parameters/Seek/seek_position", 0.0);
  28. // Play child animation from 12 second timestamp.
  29. animationTree.Set("parameters/Seek/seek_position", 12.0);
  30. .. rst-class:: classref-introduction-group
  31. Tutorials
  32. ---------
  33. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  34. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  35. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  36. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  37. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  38. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  39. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`