I’m hoping someone can steer me in the right direction for my door setup. I’ve searched high and low for the same setup I have but can’t seem to find anything.
My door animation has some complexity to it so I’m using a Level Sequence animation to open and close the door.
Here’s what I have working: Walk up to the door, press ‘E’ to open the door, walk through the door and when I leave the trigger box the doors close automatically. This works perfectly as long as I open the door every time.
However, If I walk up to the door and decide not to open it, the Reverse sequence plays when I step out of the Trigger.
You can try using a bool, set it to “TRUE” (Meaning Door Open) if you open the door, then use a branch to block the “Play Reverse” if Door Open’s bool isn’t true.
Run a print string on your, on player overlap, you will see that your getting a few player overlap and end overlap back to back, the issue with using on player overlap like this, it makes your door freak out. Something I’ve noticed with ue5… I would recommend you set a locking mechanism for when the player overlaps the trigger open door box, like do once and run the reset into the close door trigger but can only activate when they touch the trigger box outside of the other trigger box. A primative way to get it done but it works so long as the close trigger is far enough from the open trigger so the player cannot touch both at the same time and break something, hallways are the best for this.
So is the interact action part of the doors BP? Id think it would work better to bind interact action to the player, then on interact, run a line trace or some collision check for actors who have an interaction interface implemented, then have it close on end overlap. Like previously suggested using a book to check if it is open or not could help as well
I setup a Boolean and a branch for the end trigger. However, I’m still missing something. When played the branch will alternate back and forth between True and False every time I step on/off the trigger.
No worries, it’s just set up slightly off, very quickly fixable!
You just need to move the “Set DoorOpen==True” to the code where your door opens, and leave the False side Empty so it does nothing when you exit (because the door is closed).
use the status of the sequence to trigger the shutting of the door.
if it has played and completed, then the door can be closed once the end overlap is triggered.
Only play the close sequence IF the open was just played.