Opening doors with Line Trace

I’m a beginner when it comes to UE4, and I’m trying to make a level that contains multiple doors in close proximity, and the doors can be opened through Line Tracing/Raycasting (imagine a subway locker if you will). I can attach a Line Trace to the “F” use key, and I can make the door open through a trigger like stepping into a bounding box, but I can’t get the Line Trace and door opening sequence (through Timeline) to work together.

Any help would be greatly appreciated.

Try doing that in your Player Controller/Character/Whatever class:

I personally prefer to do such stuff in C++ but that should work as well. Of course you still need to set up the opening function inside your door blueprint. There you can put something like that:

And the timeline for that:

Good luck :wink:

Thank you Karlwer - that worked brilliantly. However I’m having trouble now applying it to work on multiple doors - it seems like I’m missing something simple here.

Basically I can only Cast to that one door. Is there a way to cast to multiple doors? To be able to Raycast and open whichever door it’s hitting?

You need to hook the seccond node like that:

Or just use polymorphism.

Thanks again Karwler.

Found that Blueprint Interface turned out to be exactly what I need. Created a Blueprint Interface item,and Cast the hit results to the Blueprint Interface. Then created a function within the doors to reference to the Blueprint Interface - that allowed whichever door is hit by the ray to open.