Talk:MouseOrbitZoom

I would suggest you to change these lines: public int yMinLimit = -80; public int yMaxLimit = 80;

to: public int xMinLimit = -80; public int xMaxLimit = 80;

these: xDeg = Vector3.Angle(Vector3.right, transform.right ); yDeg = Vector3.Angle(Vector3.up, transform.up );

to: xDeg = transform.eulerAngles.x;       yDeg = transform.eulerAngles.y;

and these: xDeg += Input.GetAxis("Mouse X") * xSpeed * 0.02f; yDeg -= Input.GetAxis("Mouse Y") * ySpeed * 0.02f;

////////OrbitAngle

//Clamp the vertical axis for the orbit yDeg = ClampAngle(yDeg, yMinLimit, yMaxLimit); // set camera rotation desiredRotation = Quaternion.Euler(yDeg, xDeg, 0);

to: xDeg -= Input.GetAxis("Mouse Y") * xSpeed * 0.02f; yDeg += Input.GetAxis("Mouse X") * ySpeed * 0.02f;

////////OrbitAngle //Clamp the vertical axis for the orbit xDeg = ClampAngle(xDeg, xMinLimit, xMaxLimit); // set camera rotation desiredRotation = Quaternion.Euler(xDeg, yDeg, 0);

in the Init and LateUpdate functions, respectively, in order to correctly position the camera in the first rotation (this solution is also more straightforward as it uses Unity API to retrieve the camera's Euler angles and the correct axes names - Unity convention).