Get input strength from mouse movement?

Hi. I’m trying to get my mouse to rotate my camera proportional to how much I move my mouse.

if(Input.GetAxis("Mouse X") > 0) {
			transform.Rotate(Vector3.up * Sensitivity * Time.deltaTime);
		}
		if (Input.GetAxis ("Mouse X") < 0) {
			transform.Rotate (Vector3.down * Sensitivity * Time.deltaTime);
		}
		if (Input.GetAxis ("Mouse Y") > 0) {
			transform.Rotate (Vector3.left * Sensitivity * Time.deltaTime);
		}
		if(Input.GetAxis("Mouse Y") < 0) {
			transform.Rotate(Vector3.right * Sensitivity * Time.deltaTime);
		}

The vectors are correct (In case you’re wondering). The problem is that no matter how quickly you move the mouse, the camera rotates at the same speed. I need it to be like this:
If you move your mouse slowly, the camera will spin slowly, and if you move your mouse quickly, your camera will rotate quickly.

Thanks for any help :smiley:

The reason this is happening is because you aren’t using the axis value in the value you’re passing to transform.Rotate.
Input.GetAxis() will return a variable float value corresponding to how much the mouse has moved i.e. how fast it’s moving.

Try something like:

float mouseX = Input.GetAxis("Mouse X");
if(mouseX > 0) {
    transform.Rotate(Vector3.up * Sensitivity * mouseX * Time.deltaTime;
}

And so on.