// Performs a mouse look.
public class MouseMove : MonoBehaviour
float horizontalSpeed = 2.0f;
float verticalSpeed = 2.0f;
// Get the mouse delta. This is not in the range -1...1
float h = horizontalSpeed * Input.GetAxis("Mouse X");
float v = verticalSpeed * Input.GetAxis("Mouse Y");
transform.Rotate(v, h, 0);
I don’t know my setup
so very very very frustrating
master, talk to me answer.
You can find the InputManager in Edit → Project Settings → Input Manager (press the axis buton if you actually want to see usefulll things).
To access it, you use
If you want pixels instead you use
Input.mousePosition, but keep in mind that that will differ from screen to screen, so you may want to divide by screen size.
And if you want it so that the cursor is invisable and stays in the center you can put
Screen.lockCursor = true; in