Language:
Page Info
Skill Level:
Engine Version:

Setting Up a Door

Choose your OS:

In the following steps, we are going to create a simple door that opens/closes when entering/exiting a trigger volume.

Creating the Project

In this section, we will set up the project.

  1. From the Unreal Project Browser window, create a New Project and use the Blueprint Third Person template.

    MatineeHowTo.jpg

  2. Make sure that Include starter content is enabled.

  3. Give the project a name.

  4. With each of the above defined, click Create Project to create a new project.

Placing the Door and Trigger

In this step, we will place the door and add the trigger for the door.

  1. Inside the Content Browser, find and select the Props folder and locate the SM_DoorFrame Static Mesh.

    MHT1_DoorFrame.png

    If you do not see the Props folder, refer to the Creating the Project step and make sure that you enabled Include Starter Content.

  2. Left-Click on the SM_DoorFrame Static Mesh and drag-and-drop it into the Level Viewport.

    MHT_DoorFrameDragIn.jpg

  3. Also in the Props folder, locate the SM_Door Static Mesh and drag-and-drop it into the Level Viewport.

    MHT_DoorDragIn.jpg

  4. In the Content Browser, find the SM_Door Static Mesh again and Double-Click on it to open it up in the Static Mesh viewer.

  5. Inside the Details panel, in the search field type in Collision and set the Collision Complexity setting to Use Complex Collision as Simple.

    MHT_CollisionComplexity.jpg

    The step above will ensure that the door has collision applied to it.

  6. With the SM_Door selected in the Level Viewport find the Details panel. Under Transform and the Rotation setting, set the Z value to -180.

    MHT1_RotateDoor.png

    It will auto adjust to -179.99 which is okay.

  7. Using the Translation widget, position the door inside the door frame.

    MHT1_MoveDoor.png MHT1_MoveDoor2.png

  8. Inside the Modes menu and under the Basic tab, find the Box Trigger and drag-and-drop it into the Level Viewport inside the door frame.

    MHT_DragInBoxTrigger.jpg

  9. Select the TriggerBox and in the Details panel under the Shape section, locate and change the X value for Box Extent to 140.

    MHT1_TriggerBoxSize.png

    Note: The Trigger Box extends past the door frame on the inside to allow it to open sooner (before the player approaches) as it will open inward.

    For an example of a door that opens in different directions based on which way the player enters the Trigger Box using Blueprints, refer to the 2.4 - Door With Trigger Content Example.

  10. The door and trigger are now placed, next we will add the Matinee Actor to open/close it.

Adding the Matinee Actor

In this step, we will add the Matinee Actor and set Keyframes to open/close the door.

  1. From the Toolbar menu, select Matinee and click the Add Matinee button.

    MHT_AddMatinee.jpg

  2. The Matinee undo warning message will appear, click the Continue button.

    MHT1_MatineeWarning.png

  3. The Matinee Editor window will open.

    Click for Full View.

  4. Right-Click in the Tracks window (in the empty section below All) and from the context menu, select Add New Empty Group.

    MHT1_TrackContextMenu.png

  5. When the window asking you to enter a New Group Name for the group appears enter a name for this group (in this example, we are using the name Door).

  6. Minimize the Matinee window, then in the Main Editor find the World Outliner window and select the SM_Door so that it is highlighted.

    MHT1_SelectDoor.png

  7. Return to the Matinee window and Right-Click on the Group (Door) to bring up the context menu, then select Actors then Add Selected Actors.

    MHT1_AddDoorToGroup.png

    This will add the SM_Door Actor to the Door group.

  8. Right-Click on the Group (Door) again to bring up the context menu, then select Add New Movement Track.

    MHT1_AddMovementTrack.png

  9. When the Movement Track is added, a new Keyframe will be automatically added at the time 0.00 (see 1 below) along with the track.

    MHT1_TrackExplained.png

    Note: Section 2 includes the Start/End Markers (Red Triangles), Loop Section (Green Triangles) and Time Bar (Black Bar).

  10. Left-Click on the Time Bar and drag it to the time 0.50, then press the Enter key to add a new Keyframe.

    MHT1_AddKey.png

  11. Minimize the Matinee window and return to the Level Viewport With the SM_Door still selected, press the E key to enter Rotation mode.

    MHT1_RotateWidget.png

  12. Left-Click the Blue arc of the Rotation widget (the widget will change), then rotate it to the right to -90.0 degrees.

    MHT1_DoorOpen.png

  13. Return to the Matinee window and Left-Click on the Red arrow End Marker and move it to the left to 0.50.

    MHT1_EndPointMoved.png

  14. The Matinee sequence set up is complete. In the next step, we will finish by hooking up the Matinee to the Trigger.

Hooking the Matinee up to the TriggerBox

In this step, we will hook up the Matinee to the TriggerBox so that it opens when entering the trigger and closes when exiting the trigger.

  1. From the Toolbar menu, select Blueprints and click the Open Level Blueprint button.

    MHT_OpenLvlBlueprint.jpg

  2. Minimize the Level Blueprint and through the Level Viewport or World Outliner, Left-Click on the MatineeActor to select it.

    MHT1_MatineeSceneOutliner.png

  3. Open the Level Blueprint window and Right-Click in the Event Graph, then in the context menu, select the Add Reference to MatineeActor option.

    MHT_MatineeReference.jpg

  4. This will add the MatineeActor to the Event Graph of the Level Blueprint.

    MHT1_MatineeAddedToBP.png

  5. Minimize the Level Blueprint and through the Level Viewport or World Outliner, Left-Click on the TriggerBox to select it.

    MHT1_TriggerBoxSceneOutliner.png

  6. Open the Level Blueprint window and Right-Click in the Event Graph, then in the context menu under Add Event for TriggerBox and Collision, select the Add OnActorBeginOverlap option.

    MHT1_AddOnBeginOverlap.png

  7. Right-Click in the Event Graph again, and repeat the previous step except select the Add OnActorEndOverlap option.

    MHT1_AddOnEndOverlap.png

  8. In the Event Graph find the MatineeActor node and Left-Click on and drag-off the output pin (Blue Circle) to bring up the context menu, then enter Play in the search field and select the Play option.

    MHT1_DragOffPlay.png

  9. Drag-off the MatineeActor node again and in the context menu search field, enter Reverse and select the Reverse option.

    MHT1_DragOffReverse.png

  10. Find the OnActorBeginOverlap node and drag-off the Execute output pin and connect it to the Play node's input pin.

    MHT1_ConnectOverlapToPlay.png

  11. Repeat the process above and connect the OnActorEndOverlap node's output pin to the Reverse node's input pin.

    MHT1_BlueprintConnected.png

  12. In the Level Blueprint's Toolbar menu, click the Compile Button.

    MHT1_ClickCompile.png

  13. The Blueprint is now complete and the TriggerBox is now hooked up to the Matinee Actor.

  14. Minimize the Level Blueprint and click the Play Button in the main toolbar to play in the Editor.