Hey guys. I’m trying to write a mouse look script and I’m having some problems. When I move the mouse, the camera looks in the opposite direction. Also, the camera on;y moves to a certain point and then stops. I would also like it to move a bit faster and and be more sensitive. help would be appreciated. Her’s the script:
function Update () {
transform.LookAt(Input.mousePosition);
}
You want the Standard MouseLook script. Import the Standard Asset : Scripts. It will be under camera scripts.
No, I don’t want that. Otherwise I would have used it.
Then you will have to be more specific then. You are asking for a script that allows you to control the camera view by the mouse. If that is not the definition of “Mouse Look” I don’t know what is. You even described what you are looking for to be a Mouse look script…
What exactly are you trying to do? the script you provided tells the camera to point at the screen location which is a Vector3 pointing to the location of the screen in 3d space as it relates to the current camera. If you are looking for a point beyond that than you need to specifically say “I want the point in my scene that corresponds to when I put my mouse over it.”
If that is what you want, then you will still have quite a few problems as your screen updates, moves the camera, shifts the mouse position in space and just spins things around.
Again, be specific…
1 Like