void Update () {
Debug.Log("Horizontal value:" + Input.GetAxis("Horizontal"));
Vector3 direction = Input.GetAxis("Horizontal") * transform.right +
Input.GetAxis("Vertical") * transform.forward;
transform.position = transform.position +
walkSpeed * direction * Time.deltaTime;
}
相关分类