Add a Keyboard sensor for forward movement
The Keyboard Sensor must be named forward. Can't be named Fred or Forward or anything else. The python code looks for a keyboard sensor attached to the controller named forward.
For this tutorial, I'm using the W Key for forward movement
Buttons Window menu >> Logic (F4)
Key: W key