Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- public float speed = 2f;
- CharacterController player;
- float moveFB;
- float moveLR;
- // Use this for initialization
- void Start () {
- player = GetComponent<CharacterController> ();
- }
- // Update is called once per frame
- void Update () {
- moveFB = Input.GetAxis ("Vertical") * speed;
- moveLR = Input.GetAxis ("Horizontal") * speed;
- Vector3 movement = new Vector3 (moveLR, moveFB, 0);
- movement = transform.rotation * movement;
- Player.move (movement * time.deltaTime);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement