Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma strict
- static var canmove : boolean = true;
- private var sensitivityX : float = 10.0;
- private var sensitivityY : float = 10.0;
- private var horz : float = 0;
- private var vert : float = 0;
- function Start () {
- }
- function Update () {
- if(canmove == true) {
- var deltaX : float = Input.GetAxis("Mouse X") * sensitivityX;
- var deltaY : float = Input.GetAxis("Mouse Y") * sensitivityY;
- horz += deltaX;
- vert += deltaY;
- vert = Mathf.Clamp(vert, -60.0, 60.0);
- transform.localEulerAngles = new Vector3(-vert, horz, 0);
- }
- }
Add Comment
Please, Sign In to add comment