78 Game Development and Simulation with Unreal Technology
PROGRAMMING WITH THE TIMELINE
Now with our sliding glass door’s initial location established in the ir respective
variables, we are ready to progra m the doors in such a way that when a player
walks up towards them they slide open.
In order to do this, we will use a begin overlap and an end overlap events for
each trigger. On begin overlap (which happens when a player enters the trigger
box) we will play th e tim eline. On end overlap event (which happens wh en the
player leaves th e trigg er box) we reverse the timeline.
Remember that we created a vector track in our timeline. We will use the
values of this vector track to add from the location of on e of the doors to update
its location along the timeline’s timing. This will slide the door out. For the
other door, we wish to slide it in the opposite direction. To achieve this, we will
subtract th e second door’s location from the vector track of the timeline to slide
the door to th e opposite direction.
78. Go back to the main editor by either minimizing the Blueprint Editor or moving
it out of the way, momentarily.
79. In the main editor, Left-click on the WestDoor1 glass door mesh to select it.
80. Change the Mob ility of the mesh to Movable, if it is static.
81. Change the Mobility of the other three glass door meshes and their handles to
Movable as well.
82. In the main editor Left-click on the WestTriggerBox glass door me sh to se-
lect it.
83. With the WestTriggerBox selected, scroll to the Collision section of its De ta ils
rollout.
84. Left-cli ck on the Collision Preset and fro m the dropdown list select
Custom.
85. Set the Coll ision Responses of everything to Ignore except for the Pawn.
86. Set the Coll ision Responses of the Pawn to Overlap (see Figure 2.38(a)).
87. With the WestTriggerBox still selec te d in the main editor, open the Blueprint
Editor.
88. Right-cl ick on the Event Graph to the left of the WestDoorTim eline and type
Actor Begin Overlap in the search box.
89. Select and p la ce the OnActorB eginOverlap event to the left of the
WestDoorTimeline.
90. Connect the exec(white) output of the OnActorBe ginOverlap even t to the Play
input of the WestDoorTimeline.
91. Right-cl ick on the Event Graph below of the OnActorBeg inOverlap and type
Actor End Overlap in the search box.
92. Select and place the OnActorEndOverlap event to th e left of the WestDoorTimelin e.
93. Connect the exec(white) output o f the OnActorEndOverla p event to the
Reverse input of the WestDoorTimeline.
94. Your network should look similar to Figure 2.38(b) so far.
95. Go back to the main editor by either minimizing the Blueprint Editor or moving
it out of the way, momentarily.