Making a door close after a set time

Following on from the previous tutorial, let's make the door close after a few seconds, so that the Player has to pass through it quickly.

We'll do this by closing the door in a Cutscene. The Cutscene will be set to play a set time after the door is opened. We'll do this by delaying it.

In the Scene Manager, create a new Cutscene by clicking the Cutscene prefab button, and rename it to Close door. As before, change the first Action to Object: Transform and set the Moveable object as the door.

The Vector field should be set to the opposite of what it was previously, to make the door move back to it's original position. In this example, it will be -1.5 units in the Z direction.

Again, we'll set the Transition time to 1 second, the Move method to Smooth, and the Pause until finish box unchecked.

We also want to re-enable the "use" Interaction when the door has finished closing, so add a second Action, and change it's type to Hotspot: Change interaction and use it to re-enable the Red button Hotspot's "use" Interaction.

Above the Action will be the Cutscene properties box. To delay this Cutscene by five seconds, set the Start delay to 5. So that this Cutscene does not block gameplay, change the When running field to Run In Background.

Now we'll tell the "use" Interaction to call this Cutscene. Back to the Red button_Use Interaction Inspector, change the final Action's After running field to Run Cutscene, and set the Cutscene to run to Close door.

Now the door will close again after five seconds, allowing the Player to re-open it.

Adventure Creator and this website are copyright Chris Burton, ICEBOX Studios

Go to top
Do NOT follow this link or you will be banned from the site!