Rotating a Cube: Blender Game Engine Python



 

 
1.  Add a Keyboard Sensor

Note:
For this tutorial, I'm going to use python to rotate the default cube.  We are going to use one keyboard sensor to turn the rotation on and one keyboard sensor to turn the rotation off. 

Note:
Give each keyboard sensor a unique name.  The python script needs the sensor name to find it.

Select Cube:  Object mode
Buttons Window menu >> Logic (F4)
Sensors Add:
Keyboard
Name it:  On
Key:  X key



  
2.  Add a 2nd Keyboard Sensor

Note:
Give each keyboard sensor a unique name.  The python script needs the sensor name to find it.

Select Cube:  Object mode
Buttons Window menu >> Logic (F4)
Sensors Add:
Keyboard
Name it:  Off
Key:  C key


    




 
The Blender 3D and Blender 3D game engine tutorials were created as a series of step by step instructions to help you create computer games. Casual video games, First Person Shooter, role playing games, racing simulations and more. Use the Blender 3D tutorials to model and program your own three-dimensional world and then play on your computer.