Advertisement
jretchy

Untitled

May 15th, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1. float mouseX;
  2.     float mouseY;
  3.     public float sensitivity;
  4.  
  5.     public Camera cam;
  6.  
  7.     private void Update()
  8.     {
  9.         mouseX = Input.GetAxis("Mouse X");
  10.         mouseY = Input.GetAxis("Mouse Y");
  11.  
  12.         transform.Rotate(0, mouseX * sensitivity, 0);
  13.  
  14.         cam.transform.Rotate(-mouseY * sensitivity, 0, 0);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement