class_animationnodetimeseek.rst 2.5 KB

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