Game Engine - IPO Curves

If you have a suggestion for a new tutorial or questions about Blender 3D please go to the Forum


Other Tutorial Options:Required Downloads
PDF Download

For this tutorial I will have the worded directions along with the exact keystrokes it takes to get the step done. If you are fluent enough with Blender you may not have to look at the keystrokes line. Each step within the keystrokes line will be highlighted like this: Example. Arrows will indicate that you should be following a menu path.

For this tutorial it is necessary that you download the file that goes with this. Download it now if you haven't already.

Using an IPO curve is very simple in Blender. Most of the work going into performing this task involves animating. In this tutorial I will be animating the doors that were shut through out the first tutorial.

Let’s start out by making the doors themselves easier to see. I suggest hitting ‘z’. This way it is easier to tell which half of the door is selected. You will also want to go into the animation setup for this part of the tutorial. Then select the left doorway, as seen in the image below.

-- Z, Animation View, Select the Left Door


Now we can animate the door just as if we are making an animation. First of all we have to set the duration of our doors movement. I am going to make the end frame 100, or four seconds long. Now, with your cursor in the main screen hit ‘I’ and select ‘loc’. This is the initial position of the left door. After that you will want to change your current frame to 100.

-- Change ‘end:’ to 100, I --> Loc, Change current frame to 100



Now grab the door by hitting ‘g’, hit ‘x’ then type in -1.25. This is going to be the final position of the door. So to set it in hit ‘I’ and select Loc.

-- Select the left door, G, X, Type -1.2, I --> Loc

If you play the animation you can see the door slowly slide open for you. Now we can do the same thing for the right side of the door. Go to frame 0, and select the right door. Hit ‘I’ and select loc. Move your current frame to 100. Grab the door and move it 1.25 along the x-axis. Hit ‘I’ and select loc.

-- Go to frame 1 and select the right door, hit I --> loc

-- Go to frame 100 and select the right door, G, X, Type 1.2, I --> Loc

Now if you animate your scene you can see both of the doors opening together.


Now we can put this animation into our game. This will be the same steps for both doors. I am going to make these doors act like automatic doors that open as you walk near them. To start out select one of you doors and go into the Logics Buttons (The purple pac-man). You can do this by hitting F4. Click on Actor, and hit ‘Add’ for each of the columns. Then connect the dots.

-- Select a door, F4, Click Add for each column, and connect the dots.



Now we can change some of the settings. Change the ‘Always’ setting to ‘Near’ and the ‘Motion’ setting to ‘IPO’. This means that once you get near the door, or within the distance that is set, the door is going to move according to the animation that we just made for it. Before we jump in to watch it in action in our game there are a couple of settings I want you to change.

If we played with the settings we have now, the doors will probably not open. This is because the radius we have set for our camera in order to keep it from going through walls is 1 unit. The distance we have set for the doors to open is 1 unit (You can test this in game mode if you like). To fix this I will set the ‘dist’ in the sensors column to ‘2’.

-- Change Sensor type to Near, change actuator type to IPO, Change 'dist' to 2.



Another change is in the Actuators column. We must tell the game engine the frames that we want to animate. Since we made our animation 100 frames, this is the ‘end frame that we want. If we do not change this the door will never move. Another change we want to make is the ‘Play’ selection. If we used this the door would open and then never close. These doors are meant to open and close as we move in and out of range. Change the ‘Play’ setting to ‘Flipper’. This makes the door open and close, similar to a pinball flipper goes up and down.

-- Change 'End' to 100, change 'Play' to flipper.



Now you can hit ‘p’ and move up to the door. As you may have noticed, when you got close to the door it slid open and if you backed up the door closed again. To make the other half of the door open you will want to follow the same steps for this one.

After you have done that it is time to go into game mode and test out your automatic doors.

If you have a suggestion for a new tutorial or questions about Blender 3D please go to the Forum