How to open and close multiple doors in a random sequence

Hi all, I am working on a personal project that has a room will multiple doors. Behind each door is a monster. I want to open one of the doors randomly to reveal an enemy, and then have that same door close after a delay. I am having some trouble with the closing part, and was wondering if I could get some suggestions. I have attached my current Blueprint for this project. Thanks!

What is the issue at the moment? What is wrong with the functioning? Besides not having “On Actor Begin Overlap” checking for any particular actor (player?) I don’t see an issue with the logic. That delay should be as long as the entire “Matinee” though, 0.2 seconds is pretty short unless that’s how fast you want the door to open and close…but that’s like an instant to a human eye.

So the issue I am having is that when it is time to draw the reverse function it picks a random door in the array and not the door that is already open. The delay value was just a temporary test value.

Ahh makes sense, I see now why that is. When you first pull off the “Get” you need to store that matinee actor as a variable and use the variable as the input to the “Play” and “Reverse” otherwise it basically thinks each time it should pull a “random” matinee index, that is what the code currently says. Read each node individually, the “Play” wire flows back from target to the Get node and asks for a “random” matinee, it plays that one, then has a delay, then goes to “Reverse” node, which also draws back from the target to the Get node and asks for the same thing “give me a random index” and it plays that one in reverse. The computer doesn’t understand the “logic” behind play and reverse as a human would. So you need to store the first matinee as a variable and never draw back to the Get node again in the same execution chain.

Sadly I am still very new to Blueprints and I am not sure how to do this. any pointers to a tutorial on this would be appreciated.

Never mind I got it working. Don’t exactly remember what node I used for the set, but it worls perfectly now. Thank you for the pointers.

I don’t know a specific tutorial for this but I just made one for you. I will post the link when it is done uploading…or you can figure it out yourself haha But yea that’s what I was gonna show you.