Hi everyone, I’m new at this stuff but am learning quickly. Basically, I have a (sphere) Eyeball in my scene. All I want to do, is have the eyeball track or look at the mouse when i wave it around the space. I realize i need to use 2d mouse movements with a 3d eyeball, but not sure where to begin. My goal is to have, on an iphone, the user drag their finger around the eyeball, and have the eye point wherever the user’s finger is, simple enough.
I’ve used this script, but when i go vertically, the eye spins on the wrong axis, and never looks up or down. Thanks!
var position = Input.mousePosition;
newposition = Vector3(position.x,position.y,-camera.main.transform.position.z);
var lastposition = camera.main.ScreenToWorldPoint(newposition);
transform.LookAt(lastposition);
}