using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
private float speed=5f;
private CharacterController charController;
void Start () {
charController=GetComponent<CharacterController>();
}
void Update () {
Vector3 movment=Vector3.zero;
float x=speed*Input.GetAxis("Horizontal")*Time.deltaTime;
float z=speed*Input.GetAxis("Vertical")*Time.deltaTime;
movment.x=x;
movment.y=-9.8f;
movment.z=z;
movment=transform.TransformDirection(movment);
charController.Move(movment);
}
}