pageok

  

Simple Movement -- Blender 3D Game Engine









1
Player Object Type -- Dynamic

Note:
Movement.py uses the player's positive Y-axis for forward.  Negative Y-axis for back.  Positive X-axis for right.  Negative X-axis for left.  Positive Z-axis for up.  Negative Z-axis for down.

Select Player (Cube)
Buttons Window menu >> Logic (F4)
Object Type:  Dynamic


2
Add a Keyboard sensor for forward movement

Note:
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.

Note:
For this tutorial, I'm using the W Key for forward movement

Buttons Window menu >> Logic (F4)
Sensors Add
Keyboard Sensor
Name: forward
Key: W key

 

3
Add a Keyboard sensor for backwards movement

Note:
The Keyboard Sensor must be named back.  Can't be named Fred or Back or anything else.  The python code looks for a keyboard sensor attached to the controller named back.

Note:
For this tutorial, I'm using the S Key for backward movment

Buttons Window menu >> Logic (F4)
Sensors Add
Keyboard Sensor
Name: back
Key: S key



  




 
pageok