Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. void Update () {
  2. float disX = Input.GetAxis ("Horizontal") * sensitivity * Time.deltaTime;
  3. float disZ = Input.GetAxis ("Vertical") * sensitivity * Time.deltaTime;
  4. Vector3 move = new Vector3 (disX, 0, disZ);
  5. move = transform.TransformDirection (move);
  6. _charController.Move (move);
  7. }
  8.  
  9. void Update () {
  10. _rotationX -= Input.GetAxis ("Mouse Y") * sensitivity * Time.deltaTime;
  11. _rotationY += Input.GetAxis ("Mouse X") * sensitivity * Time.deltaTime;
  12. transform.localEulerAngles = new Vector3(_rotationX, _rotationY, 0);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement