How to make a sliding door in Unreal Engine 4/5 with Blueprints
A sliding door changes its location instead of rotating. Duplicate the pivot door Blueprint, remove the Arrow and the Set Relative Rotation, edit the Timeline DoorLocation to go from 0 to -116 in one second and drive Set Relative Location on X, keeping the door's original Y and Z so it does not move on the other axes.
From the course
Taken from the hands-on project of the course; the lessons show every step on video.
What do I start from?
The previous pivot door Blueprint, duplicated and renamed Slide Door Blueprint. It already has the highlight, the key that opens and closes, a Timeline and a Set Relative Rotation that uses an Arrow as the pivot.
What do I change in the viewport?
- Delete the Arrow and the Set Relative Rotation node: a sliding door needs no pivot.
- Detach the door from the Arrow.
- Move the door on the X axis, as if along a track, to see the position where it is fully open. In the lesson it is about -116. Undo to the starting position.
How do I animate the location?
- Edit the Timeline: rename it DoorLocation and double-click it. The first keyframe has time 0 and value 0, the starting position. The last has time 1 and value -116, the open position.
- Rename the Float Track to Location.
- In the Event Graph get the door mesh (the Cube) and call Set Relative Location. Split the vector pin into three floats, connect Location to X and the Timeline Update to the function's execution.
Why did the door move on Y and Z too?
On the first test the highlight works and the key moves the door, but the other axes changed. In the Blueprint viewport copy the initial values of the door: about 0 on Y and about 106 on Z, and type them into the Y and Z pins. Compile, save and test: the door opens correctly, and pressing the key again closes it thanks to the Flip Flop.
Free PDFs that go with this page
One-page guides made from the lessons, sent by e-mail.
- Interactive archviz delivery checklist — The things that go wrong in interactive scenes, checked one by one, each item tied to a lesson.
- Blueprint Cheat Sheet — A free one-page PDF for Unreal Engine 4/5, made from the lessons of the course. Keep it next to your editor while you learn.
- Free PDFs
Frequently asked questions
What changes between a pivot door and a sliding door?
Instead of Set Relative Rotation on an Arrow, you use Set Relative Location on the door mesh.
Why must I fill Y and Z?
Set Relative Location needs all three axes; leaving them at 0 moves the door to the wrong place.
How far does the door move in the lesson?
To -116 on the X axis, in one second.