Hello,
I’m trying to use the lookAt function to rotate an object towards the mouse the cursor. The object is a human face created in Blender and it has two children objects for the eyes.
I’m using an invisible plane to raycast the mouse position and in a loop I call the lookAt function on the face object and the eyes. The face rotates perfectly, following the mouse, but the eyes are stuck.
If I try to only move the eyes, they rotate fine as well.
Even if you don’t comment out this line, they eyes slightly rotate so they looking towards the defined target position. The effect is not that noticeable since the head is also transformed. From my point of view, the overall behavior of the transformation is as expected.
I think you are right. I’d like, though, to make the eyes movement more evident. I’m thinking of a way to limit the movement of the head, instead, so I tried this:
object.lookAt(point.clampScalar(-50, 50));
It kind of does what I want, but somehow it causes some issues in the eyes movement.