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.
Here’s a pen with the whole example working: https://codepen.io/qarlo/pen/9ed6626a793227cc3a2d8ef122927686
Commenting the line at row 109 makes the eyes rotating.
Is there a limitation in the function so that I can’t use it on the children or something like this? And in case, what would be the best approach?