# CharacterController rotation with mouse

I'm trying to rotate my characterController around with the mouse movement. I've tried to do so with this:

rotLeftRight = Input.GetAxis("Mouse X") * MOUSESENSIVITY * Time.deltaTime; rotUpDown = -Input.GetAxis("Mouse Y") * MOUSESENSIVITY * Time.deltaTime;

It works fine when I just move the mouse, but Input.getAxis returns 0 if you don't move the mouse, even if it's already on a corner of the screen. Is this normal?

What I need is something that returns 0 only when the mouse is in the center of the screen. I don't know if that is posible using Input.GetAxis or I should use another function.

Anybody can help me with this?

Input.GetAxis() returns the velocity of the axis in that frame. For example, getting the x-axis from a controller with a joystick will return the same thing as if you had moved your mouse to the right a certain amount. Input.GetAxis() will not tell you the overall movement of the mouse over multiple frames, or the position of the mouse on the screen.
To get the mouse position, use Input.mousePosition. If you want that value to be 0 when the mouse is at the center of the screen rather than the corner, subtract half of the screen size (this vector: new Vector2 (Screen.width/2, Screen.height/2)). For more information, check out the Unity docs: Input.mousePosition