Hi, I'm doing a camera-only motion using rotation, However the z-axis moves and I want to set only the z-axis to 0. But eulerAngle, transform.rotation Of error. what can I do?
The camera is "rolling"? Because you're probably trying to use Euler angles, when you should be using Quaternions. Look at the First person MouseLook.cs script in the standard assets for a guide: float yRot = Input.GetAxis("Mouse X") * XSensitivity; float xRot = Input.GetAxis("Mouse Y") * YSensitivity; targetRotation *= Quaternion.Euler (0f, yRot, 0f); targetRotation *= Quaternion.Euler (-xRot, 0f, 0f); No roll will occur.