74 Game Development and Simulation with Unreal Technology
18. Double-c lick on the timeline to open it up in the curve editor.
19. Check the checkbox Use Last Keyframe? for the WestDo orTimeline.
20. Left-cli ck on the V
+
icon to add a Vector Track to your timeline (see Fig-
ure 2.34(b)).
21. Rename the Vect or Track to WestDoor wayTrack.
22. Hold the Shift key on your keyboar d and Left-cli ck on the track at time 0.0
to a dd a key in tha t location along the timeline.
23. Hold the Shift key on your keyboar d and Left-cli ck on the track at time 2.0
to a dd another key in that location along the timeline.
24. We would like to have the doors slide along their Y-axes. We will lock the X- and
Z- axes. To do so, Left-click on the lock ic on next to the X- and Z- axes.
25. With the X- and Z- axes locked, we c an now enter values in our Y component of
the vector tra ck. We would like the door to slide about 250 units along its Y- axis.
26. Left-cli ck on the key (the d ia mond shape) on at time 2.0 and type the value
of 250 in the Value box on the upper left corner of the curve editor (see Fig-
ure 2.34(b)).
27. If th e key fr ame sna ps out of the view, you can re-scale the curve editor by clicking
on the l on the upper left corner of the editor.
28. Repeat Steps 13–27 to create another timeline and Vector track for th e East
Door. Name this timeline E astDoorTimeline and its corresponding Vector track
EastDoorwayTrack.
ESTABLISHING INITIAL DOOR LOCATIONS
Now that we have our timelines and vector tracks for the lo cations of sliding
doors ready, it is the time to start programming. In this step, we will establish
the initial locations of the four sliding glass doors and store these values in
variables. Remember that we have two sliding doors for the west entrance and
two for the ea st entrance to the lobby.
29. Left-cli ck on the new Variable (
+
V icon) u nder the My Blueprint tab to
create a new variable in your level blueprint.
30. Rename this variable to WestDoor1L ocation.
31. In the WestDoo r1Location variable’s Details rollout, click on the Variable
Type drop-down list and choose Vector (see Fig ure 2.35(a) ).
32. Create three additional variables of type Vector and ren ame them to
WestDoor2Location, EastDoor1Locatio n, and EastDoor2Loc ation.
33. Your My Blueprint tab should look similar to Figure 2.35(b) .
34. Go back to the main editor by either minimizing the Blueprint Editor or moving
it out of the way, momentarily.
35. In the main editor, Left-click on the WestDoor1 glass door mesh to select it.
36. With the WestDoor1 selected, go back to the Blueprint Editor.
37. Right-cl ick on the Event Graph.
38. From the menu select the Add Reference to WestDoor1 (see Figure 2.36(a)).
39. Right-cl ick above the West Door1 reference on the Event Graph.