For some reason i can look up and down, but when i look left and right the camera wants to snap back to zero on that axis. I know normally you’d want to rotate the object the camera is parented to horizontally rather than the camera itself but with this i only want to rotate the camera.
if (!cameraLocked)
{
horizontal = Input.GetAxis ("Mouse X") * mouseSensitivity;
horizontal = Mathf.Clamp (horizontal, -60, 60);
vertical -= Input.GetAxis ("Mouse Y") * mouseSensitivity;
vertical = Mathf.Clamp (vertical, -60, 60);
Camera.main.transform.localRotation = Quaternion.Euler(vertical, horizontal, 0);
}