I just started learning Unity. I tried to make a simple box move by using this script. The premise is, whenever someone presses \'w\' the box moves forward.
Instead of making w a bool, you can use axis, also, in unity editor you should make it so the rigidbody movement is frozen
w
here is some code
void update() { rb.AddForce(Input.GetAxis("Horizontal")); }