-
Hey guys :) Quick question: how do I sync mouse movement with model's eyes, so that it always looks at the camera? I understand that it has something to do with lookAt, i found a working sample, but there the person used lookAt.target = camera syntax, which is not working for me since target property is missing. So what would be the approach? Thanks :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
To make the avatar's eyes always look at the camera, use "vrm.lookAt.target = camera" as you said. const vrm = gltf.userData.vrm;
vrm.lookAt.target = camera;
// Render loop
function animate() {
requestAnimationFrame( animate );
const deltaTime = clock.getDelta();
if ( currentVrm ) {
// Need update vrm
currentVrm.update( deltaTime );
}
renderer.render( scene, camera );
}
animate(); Here is the API reference for that. |
Beta Was this translation helpful? Give feedback.
To make the avatar's eyes always look at the camera, use "vrm.lookAt.target = camera" as you said.
Here is the API reference for that.
https://pixiv.github.io/three-vrm/packages/three-vrm/docs/classes/VRMLookAt.html#target