In Unreal Engine, a rotating door adds interactivity to your game. This tutorial explains how to create a door that rotates open and closed when the player interacts with it.
Start by creating a new Blueprint Class. Choose “Actor” as the parent class and name it “RotatingDoor_BP.” Open the Blueprint Editor to set up the components.
Add a “Static Mesh” component to the Blueprint for the door’s appearance. Select a suitable mesh, such as a rectangular door model, from the Content Browser or import your own. Adjust its position and scale to fit your level.
Next, add a “Box Collision” component around the door. This will detect when the player interacts with the door. Resize the box to cover the area in front of the door where the player will trigger the rotation.
Go to the Event Graph to add logic for rotating the door. Add an “On Component Begin Overlap” event for the Box Collision. This event will execute when the player enters the collision area.
To make the door rotate, add a “Timeline” node to control the rotation smoothly. Double-click the Timeline to open the Timeline Editor. Add a “Float Track” and create two keyframes:
- Time = 0, Value = 0 (door is closed).
- Time = 1, Value = 90 (door is fully open, rotates 90 degrees).
In the Event Graph, connect the Timeline’s “Update” pin to a “Set Relative Rotation” node. Set the target as the door’s Static Mesh component. Use a “Make Rotator” node to specify the rotation axis. Connect the float output from the Timeline to the Yaw input of the Make Rotator node, as doors typically rotate around the Yaw axis.
To close the door, add an “On Component End Overlap” event for the Box Collision. Connect this event to the “Reverse” pin of the Timeline to play the rotation backward, returning the door to its closed position.
Test the rotating door by placing the Blueprint in the level. Play the game and walk into the collision area to open the door. Step out to see it close. Adjust the Timeline duration or rotation values if needed to fine-tune the animation.
This setup creates a simple rotating door that enhances interactivity in your game. You can customize it further by adding sound effects, locking mechanisms, or triggers based on specific player actions.
![](https://www.vskills.in/certification/tutorial/wp-content/uploads/2025/01/practice-test-banners.png)