Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- float disX = Input.GetAxis ("Horizontal") * sensitivity * Time.deltaTime;
- float disZ = Input.GetAxis ("Vertical") * sensitivity * Time.deltaTime;
- Vector3 move = new Vector3 (disX, 0, disZ);
- move = transform.TransformDirection (move);
- _charController.Move (move);
- }
- void Update () {
- _rotationX -= Input.GetAxis ("Mouse Y") * sensitivity * Time.deltaTime;
- _rotationY += Input.GetAxis ("Mouse X") * sensitivity * Time.deltaTime;
- transform.localEulerAngles = new Vector3(_rotationX, _rotationY, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement