Advertisement
kadyr

Untitled

Nov 5th, 2021
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. //now for the mouse rotation
  2. rotX += Input.GetAxis("Mouse X")*RotSpeed;
  3. rotY += Input.GetAxis ("Mouse Y")*RotSpeed;
  4.  
  5. rotY = Mathf.Clamp(rotY, -90f, 90f);
  6.  
  7. //Camera rotation only allowed if game us not paused
  8. Camera.transform.rotation = Quaternion.Euler(-rotY, 0f, 0f);
  9. transform.rotation = Quaternion.Euler(0f, rotX, 0f);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement