Question by
RoxoL · Apr 24, 2017 at 11:12 PM ·
rotationcamera rotation
Rotation Limit ?
Hi, i´m very new in unity (and obviously my english is not very good Dx) so I have a first person camera with a rotation.y by MouseX, but the camera can rotate 360 how can i limit the rotation.Y to fix that ?
if (FirstPerson == true)
{
firstpersoncamera.transform.position = new Vector3(player.transform.position.x, player.transform.position.y + 1, player.transform.position.z);
rot = Input.GetAxis("Mouse Y");
firstpersoncamera.transform.Rotate(0, -(rot * turnSpeed * Time.deltaTime), 0);
}
Comment
Your answer