|
Blender Game Engine - tutorial 2 |
Download controls_start.blend and controls_finished.blend. Open controls_finished.blend. |
|
STEP 1: You should see a simple arrow object resting above a small plane shape. If you press "p" while your mouse is over the wireframe viewport you will enter the Blender Real-Time Game Engine mode. All editing controls are now locked and you can only interact with the viewport you are running the game from. |
![]() |
STEP 2: The arrow object has been set up with the basic logic needed to move it around in 3D space. If you want to look at the logic brick setup now go to the logic panel by selecting the little purple pac-man or by pressing "F4". You can use this file as a reference if you get stuck or if something isn't working right with your setup. STEP 3: Now open controls_start.blend. |
![]() |
STEP 4: Activate the "Actor" button in the upper left corner of the panel. This tells the game engine that you want to exert some sort of control over this object in the game engine. Then activate the "Dynamic" button that appears. This makes it react to other objects in the scene using the physics simulation built in to the game engine. It also brings up more options. We will explain briefly only the options we need for this tutorial. |
|
STEP 5: The first option to adjust is "Mass". Change its value to 0.7. This does not make the object respond any differently to gravity, but changes the way it interacts with other objects. |
![]() |
STEP 6: The next option to adjust is "Size". Change its value to 2.3. This changes the size of the invisible collision sphere that surrounds your object. |
![]() |
STEP 7: Next, change "RotDamp" to 0.6. This is Rotation Dampening. It will slow down the rotation of your object making it easier to control. |
![]() |
STEP 8: Then activate "Anistropic". This adds x, y, and z friction attributes that can remain the default value of 1.0. This will affect the way your object "skids" as you are moving and turning at the same time. You won't notice much of an effect with this example, but it is useful to know about and also helps control the object. |
![]() |
STEP 9: Next you can see three columns: Sensors, Controllers, and Actuators. Simply put, the Sensor takes input and sends it to an Actuator which does something with that input. The Controller allows you to manipulate the input being sent. The communication travels only one direction (Sensor to Controller to Actuator). You can make multiple connections, but that won't be neccessary for our example. STEP 10: Click "Add" once underneath each of the three columns. Now click and drag the little gold ball from Sensor to the little gold ring in the Controller. Do the same to connect the Controller to the Actuator. There should be black lines linking them now. Change the sensor type from Always to Keyboard. Click once in the Key field and press the "UPARROW" on the keyboard. This tells the arrow object to do something when the "UPARROW" key is pressed during the game. Now where it says sensor, type in "Uparrow" (no quotes). This is just to give the sensor a label. |
|
STEP 11: Now under the Actuator column you will see the type is set to Motion. This is what we want. The three columns of values represent X, Y, and Z values in that order. Change the Force Z value to 40. Change the word act to "forward" to give this actuator a label. To try it out now press "p" when your mouse is over a viewport to start the game engine. Now press the "UPARROW" to see your object move forward. Press "ESC" to stop the game engine. |
|
STEP 12: Now click "Add" again underneath each of the three columns in the logic panel. Connect them up in the same way as before. Change the Sensor type to Keyboard and assign the "DOWNARROW" to the Key field. Label this sensor "Downarrow". Change the Force Z Actuator value to -40. Label it "backward". Now your object will go forwards and backwards. At this point you may want to close the Sensors, Controllers, and Actuators to make room for more. Do this by clicking the orange arrow next to each one. STEP13: Now click "Add" again under each of the three columns. Connect them and change the Sensor type to Keyboard. This time assign the "LEFTARROW" to the key field and label the sensor "Leftarrow". Change the Torque Y value to 6 and label the Actuator "left". STEP 14: Add one more to each column, assign "RIGHTARROW" to the Keyboard key and set Torque Y to -6. Now try it out ("p"). If it doesn't seem to work, make sure all your connections are made and that you have values set in the correct fields. If you are still stuck, refer back to the controls_finished.blend file. |
|
STEP 15: This is just a very beginning step to move your "player" around in the game. Try playing with different values in the motion actuator to see how speed and control are affected. Also, play with Mass and Dampening values to understand what they can do. Try adding more controls. Set the "SPACE" bar to make your player jump, for example. If you want to learn how to make your player fly, float, or swim, read the tutorial on Floating Objects. |
![]() click to see full screen image |

























