#Eye movement animation

1 messages · Page 1 of 1 (latest)

raw light
#

Hello guys,
I am currently working on animating the eye movement. I want the eyes of one of my models to follow the camera.

I watched some youtube and made something that satisfies my needs, but there are few problems.

I did something like leftEye.transform.LookAt(camera.transform), but the orientation of the eye doesn't really match the iris position, so instead of following the camera with the iris, it follows it with eye's white.
My workaround was to find an appropriate rotation such that it makes iris follow the camera.


leftEye.transform.LookAt(camera.transform); 

leftEye.transform.Rotate(new Vector3(10, 90, -13));

This is the approximate code which is put into the void LateUpdate()

I figured out those 10, 90, -13 values by hand, by constantly tweaking a little bit and running over and over again in the editor.

It works fine, but as soon as I move camera to the sides, the eyes do not follow the camera, but somewhere ahead of the camera, this results in model's eyes looking ahead of camera position.

How do I dix that?