How to Make a Door & Interaction System in UE5 Blueprints

The door is the classic interaction-system teaching case because it forces the right architecture: the player shouldn’t know what a door is. The player traces, asks "are you interactable?", and the door handles being a door.

What it’s made of

Variables

On the player: InteractionDistance float. On the door: a bIsOpen bool and a Timeline driving the rotation.

Events

An IA_Interact input fires the trace; a Blueprint Interface (BPI_Interact with an Interact function) is the contract every interactable implements — doors, switches, pickups alike.

The logic

On interact: Line Trace By Channel from the camera forward by InteractionDistance. Does Implement Interface? → call Interact on the hit actor (no casting to specific classes). The door’s Interact flips bIsOpen and plays a Timeline whose float track Lerps the door’s yaw between closed and open — Timeline gives you the curve, reversibility, and interrupt-safety for free.

Key nodes you’ll wire

Line Trace By ChannelGet Camera Location/ForwardDoes Implement InterfaceBlueprint Interface callTimelineLerp (Float)Set Relative Rotation

The mistake that breaks it

Cast To Door in the player. The moment you add a second interactable, casting-per-type collapses — the interface IS the system.

New to how Blueprint systems fit together? Read the anatomy of a Blueprint system first.

Or skip the wiring — generate it

BlueprintStudio builds this system from a plain-language prompt — the right nodes, exec and data pins wired, defaults set — and tells you whether it is ready to paste or what to set up first. The prompt is prefilled:

Build “Door & Interaction System” in BlueprintStudio

Prompt variations to try

Paste it into your Blueprint, or apply it with the free Cosindra desktop app (Windows & macOS).

Common questions

Blueprint Interface or Cast To for an interaction system?

Interface. Cast To Door hard-references the door class from the player, and every new interactable type means another cast branch and another class loaded into memory. With BPI_Interact you check Does Implement Interface once and send the same message to doors, levers, and pickups alike — actors that don’t implement it simply ignore the call. The player never learns what a door is.

Why does my line trace never hit the door?

Almost always collision, not the trace. Line Trace By Channel on Visibility only hits meshes whose Collision Presets block the Visibility channel — check the door mesh, not the Blueprint. While debugging, set the node’s Draw Debug Type to For Duration so the ray is visible; a line shooting out of the actor’s feet means you traced from the actor instead of the camera.

How do I reverse the door animation if it’s interrupted mid-swing?

Use the Timeline’s Reverse input, not Play from Start. Reverse runs the track backward from its current position, so a door interrupted halfway swings back from halfway instead of snapping shut and replaying. Wire the Interact event through a Branch on bIsOpen — true goes to Reverse, false to Play — then flip the bool. That pair is the whole open/close state machine.

More systems