2 using System.Collections.Generic;
7 private float speed = 2;
11 rb = this.GetComponent<Rigidbody>();
16 float moveHorizontal = Input.GetAxis(
"Horizontal");
17 float moveVertical = Input.GetAxis(
"Vertical");
19 Vector3 movement =
new Vector3(moveHorizontal, 0.0f, moveVertical);
20 rb.AddForce(movement * speed);