:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the SkeletonModification3DLookAt.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_SkeletonModification3DLookAt: SkeletonModification3DLookAt ============================ **Inherits:** :ref:`SkeletonModification3D` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` A modification that rotates a bone to look at a target. Description ----------- This :ref:`SkeletonModification3D` rotates a bone to look a target. This is extremely helpful for moving character's heads to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. Properties ---------- +---------------------------------+-------------------------------------------------------------------------------------+------------------+ | :ref:`int` | :ref:`bone_index` | ``-2`` | +---------------------------------+-------------------------------------------------------------------------------------+------------------+ | :ref:`String` | :ref:`bone_name` | ``""`` | +---------------------------------+-------------------------------------------------------------------------------------+------------------+ | :ref:`NodePath` | :ref:`target_nodepath` | ``NodePath("")`` | +---------------------------------+-------------------------------------------------------------------------------------+------------------+ Methods ------- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_additional_rotation` **(** **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_lock_rotation_plane` **(** **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_lock_rotation_to_plane` **(** **)** |const| | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_additional_rotation` **(** :ref:`Vector3` additional_rotation **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_lock_rotation_plane` **(** :ref:`int` plane **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_lock_rotation_to_plane` **(** :ref:`bool` lock_to_plane **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_SkeletonModification3DLookAt_property_bone_index: - :ref:`int` **bone_index** +-----------+-----------------------+ | *Default* | ``-2`` | +-----------+-----------------------+ | *Setter* | set_bone_index(value) | +-----------+-----------------------+ | *Getter* | get_bone_index() | +-----------+-----------------------+ The bone index of the bone that should be operated on by this modification. When possible, this will also update the :ref:`bone_name` based on data provided by the :ref:`Skeleton3D`. ---- .. _class_SkeletonModification3DLookAt_property_bone_name: - :ref:`String` **bone_name** +-----------+----------------------+ | *Default* | ``""`` | +-----------+----------------------+ | *Setter* | set_bone_name(value) | +-----------+----------------------+ | *Getter* | get_bone_name() | +-----------+----------------------+ The name of the bone that should be operated on by this modification. When possible, this will also update the :ref:`bone_index` based on data provided by the :ref:`Skeleton3D`. ---- .. _class_SkeletonModification3DLookAt_property_target_nodepath: - :ref:`NodePath` **target_nodepath** +-----------+------------------------+ | *Default* | ``NodePath("")`` | +-----------+------------------------+ | *Setter* | set_target_node(value) | +-----------+------------------------+ | *Getter* | get_target_node() | +-----------+------------------------+ The NodePath to the node that is the target for the modification. Method Descriptions ------------------- .. _class_SkeletonModification3DLookAt_method_get_additional_rotation: - :ref:`Vector3` **get_additional_rotation** **(** **)** |const| Returns the amount of extra rotation that is applied to the bone after the LookAt modification executes. ---- .. _class_SkeletonModification3DLookAt_method_get_lock_rotation_plane: - :ref:`int` **get_lock_rotation_plane** **(** **)** |const| Returns the plane that the LookAt modification is limiting rotation to. ---- .. _class_SkeletonModification3DLookAt_method_get_lock_rotation_to_plane: - :ref:`bool` **get_lock_rotation_to_plane** **(** **)** |const| Returns whether the LookAt modification is limiting rotation to a single plane in 3D space. ---- .. _class_SkeletonModification3DLookAt_method_set_additional_rotation: - void **set_additional_rotation** **(** :ref:`Vector3` additional_rotation **)** Sets the amount of extra rotation to be applied after the LookAt modification executes. This allows you to adjust the finished result. ---- .. _class_SkeletonModification3DLookAt_method_set_lock_rotation_plane: - void **set_lock_rotation_plane** **(** :ref:`int` plane **)** ---- .. _class_SkeletonModification3DLookAt_method_set_lock_rotation_to_plane: - void **set_lock_rotation_to_plane** **(** :ref:`bool` lock_to_plane **)** When ``true``, the LookAt modification will limit its rotation to a single plane in 3D space. The plane used can be configured using the ``set_lock_rotation_plane`` function. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`