Rotation issue

For some reason, when I rotate the character up to 180 degrees, it wont let me keep rotating around full 360. I’m using mouse movement for rotation.

	var lookDirection = Input.GetAxis("Mouse X") * Time.deltaTime * sensitivity;
	transform.localRotation.y += lookDirection;

Really confused about this. Not sure why it wont let me rotate around full circle.

The standard Script MouseOrbit has a function that would fix this. :wink:

It verifies the amount that you rotate and keeps it around 0 - 360 I think.

So the character just stops rotating at 180? Why dont you take a different approach and just use transform.Rotate(0, lookdirection, 0)

localRotation is a 4-dimensional quaternion, and rotation.y isn’t the y axis.

–Eric

Thanks alot, that fixed it!