Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. var camSpeed = 10;
  2.  
  3. function Update ()
  4. {
  5. var camTrans = Camera.main.transform;
  6.  
  7. camTrans.Rotate(0, Input.GetAxis("rotate"), 0, Space.World);
  8. camTrans.position += new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")) * Time.deltaTime * camSpeed;
  9. camTrans.position += camTrans.TransformDirection(new Vector3(0, 0, Input.GetAxis("Zoom")) * Time.deltaTime * camSpeed);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement