#Trying to lerp a “looking_at():” function.

3 messages · Page 1 of 1 (latest)

lilac olive
#

I have a character that is rigged, and has a few lines of code in it to make it look at the player using the head bone if the player is within a certain area . I dont like how it snaps to the player instantly though. How would I lerp this code?

RangeArea.get_overlapping_bodies():
        if body.is_in_group("Player"):
            if !interacting:
                bone_pose = bone_pose.looking_at(looktarget.global_position)
                Skeleton.set_bone_global_pose_override(1, Skeleton.global_transform.affine_inverse()*bone_pose, 1.0, true)```
#

The looktarget variable is a node3d on the player object

hexed zenith