user37391
0
Q:

how to clamp transform.rotation

 headRotation = Input.GetAxis("Mouse Y") * speed;
 transform.Rotate(0, 0, -headRotation, Space.Self);
 transform.eulerAngles.y = Mathf.Clamp(transform.eulerAngles.y, -90, 90);
1
transform.rotation = closestTransform.rotation;
0

New to Communities?

Join the community