The [LookAtModifier3D] rotates a bone to look at a target.
This [SkeletonModifier3D] rotates a bone to look at a target. This is helpful for moving a character's head 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. When applying multiple [LookAtModifier3D]s, the [LookAtModifier3D] assigned to the parent bone must be put above the [LookAtModifier3D] assigned to the child bone in the list in order for the child bone results to be correct.
Returns the remaining seconds of the time-based interpolation.
Returns [code]true[/code] if time-based interpolation is running. If [code]true[/code], it is equivalent to [method get_interpolation_remaining] returning [code]0.0[/code]. This is useful to determine whether a [LookAtModifier3D] can be removed safely.
Returns whether the target is within the angle limitations. It is useful for unsetting the [member target_node] when the target is outside of the angle limitations. [b]Note:[/b] The value is updated after [method SkeletonModifier3D._process_modification]. To retrieve this value correctly, we recommend using the signal [signal SkeletonModifier3D.modification_processed].
- Index of the [member bone_name] in the parent [Skeleton3D].
- The bone name of the [Skeleton3D] that the modification will operate on.
- The duration of the time-based interpolation. Interpolation is triggered at the following cases: - When the target node is changed - When an axis is flipped due to angle limitation [b]Note:[/b] The flipping occurs when the target is outside the angle limitation and the internally computed secondary rotation axis of the forward vector is flipped. Visually, it occurs when the target is outside the angle limitation and crosses the plane of the [member forward_axis] and [member primary_rotation_axis].
- The ease type of the time-based interpolation. See also [enum Tween.EaseType].
- The forward axis of the bone. This [SkeletonModifier3D] modifies the bone so that this axis points toward the [member target_node].
- Index of the [member origin_bone_name] in the parent [Skeleton3D].
- If [member origin_from] is [constant ORIGIN_FROM_SPECIFIC_BONE], the bone global pose position specified for this is used as origin.
- If [member origin_from] is [constant ORIGIN_FROM_EXTERNAL_NODE], the global position of the [Node3D] specified for this is used as origin.
- This value determines from what origin is retrieved for use in the calculation of the forward vector.
- The offset of the bone pose origin. Matching the origins by offset is useful for cases where multiple bones must always face the same direction, such as the eyes. [b]Note:[/b] This value indicates the local position of the object set in [member origin_from].
- If the target passes through too close to the origin than this value, time-based interpolation is used even if the target is within the angular limitations, to prevent the angular velocity from becoming too high.
- The threshold to start damping for [member primary_limit_angle]. It provides non-linear (b-spline) interpolation, let it feel more resistance the more it rotate to the edge limit. This is useful for simulating the limits of human motion. If [code]1.0[/code], no damping is performed. If [code]0.0[/code], damping is always performed.
- The limit angle of the primary rotation when [member symmetry_limitation] is [code]true[/code], in radians.
- The threshold to start damping for [member primary_negative_limit_angle].
- The limit angle of negative side of the primary rotation when [member symmetry_limitation] is [code]false[/code], in radians.
- The threshold to start damping for [member primary_positive_limit_angle].
- The limit angle of positive side of the primary rotation when [member symmetry_limitation] is [code]false[/code], in radians.
- The axis of the first rotation. This [SkeletonModifier3D] works by compositing the rotation by Euler angles to prevent to rotate the [member forward_axis].
- The relative option. If [code]true[/code], the rotation is applied relative to the pose. If [code]false[/code], the rotation is applied relative to the rest. It means to replace the current pose with the [LookAtModifier3D]'s result. [b]Note:[/b] This option affects the base angle for [member use_angle_limitation] unlike [IterateIK3D]'s [JointLimitation3D]. Since the [LookAtModifier3D] relies strongly on Euler rotation, the axis that determines the limitation and the actual rotation are strongly tied together.
- The threshold to start damping for [member secondary_limit_angle].
- The limit angle of the secondary rotation when [member symmetry_limitation] is [code]true[/code], in radians.
- The threshold to start damping for [member secondary_negative_limit_angle].
- The limit angle of negative side of the secondary rotation when [member symmetry_limitation] is [code]false[/code], in radians.
- The threshold to start damping for [member secondary_positive_limit_angle].
- The limit angle of positive side of the secondary rotation when [member symmetry_limitation] is [code]false[/code], in radians.
- If [code]true[/code], the limitations are spread from the bone symmetrically. If [code]false[/code], the limitation can be specified separately for each side of the bone rest.
- The [NodePath] to the node that is the target for the look at modification. This node is what the modification will rotate the bone to.
- The transition type of the time-based interpolation. See also [enum Tween.TransitionType].
- If [code]true[/code], limits the amount of rotation. For example, this helps to prevent a character's neck from rotating 360 degrees. [b]Note:[/b] As with [AnimationTree] blending, interpolation is provided that favors [method Skeleton3D.get_bone_rest] or [method Skeleton3D.get_bone_pose] depends on the [member relative] option. This means that interpolation does not select the shortest path in some cases. [b]Note:[/b] Some values for [member transition_type] (such as [constant Tween.TRANS_BACK], [constant Tween.TRANS_ELASTIC], and [constant Tween.TRANS_SPRING]) may exceed the limitations. If interpolation occurs while overshooting the limitations, the result might not respect the bone rest.
- If [code]true[/code], provides rotation by two axes.
The bone rest position of the bone specified in [member bone] is used as origin.
The bone global pose position of the bone specified in [member origin_bone] is used as origin. [b]Note:[/b] It is recommended that you select only the parent bone unless you are familiar with the bone processing process. The specified bone pose at the time the [LookAtModifier3D] is processed is used as a reference. In other words, if you specify a child bone and the [LookAtModifier3D] causes the child bone to move, the rendered result and direction will not match.
The global position of the [Node3D] specified in [member origin_external_node] is used as origin. [b]Note:[/b] Same as [constant ORIGIN_FROM_SPECIFIC_BONE], when specifying a [BoneAttachment3D] with a child bone assigned, the rendered result and direction will not match.