public class move : MonoBehaviour {
public float speed = 10f;
public float H;
public float V;
void Update () {
H = Input.GetAxis("Horizontal") * Time.deltaTime * speed;
V = Input.GetAxis("Vertical") * Time.deltaTime * speed;
this.gameObject.transform.Translate(H, 0, V);
}
}
网友评论