Remove actors will trigger a door

Somehow I feel like this should be something simple to figure out, however I can’t seem to find out the solution to this.

So basically there is a group of actors that needs to be removed from the level (basically they get killed.) Before a door will open.

Logically I was thinking of assigning these actors into an array and then make a check to see if all of the actors within the array are removed or not. Yet I can’t figure out what functions or nodes I need in the Blueprint to set this up. I was thinking of doing an Event Tick but that might be a performance issue. So I thought of doing an EventEndPlay for each actor within the group. From there I just got stuck as to what I should do next. I posted a screenshot as to what I did so far but it’s nothing special anyway…

Thank you

I’m new at this, but I don’t think it will be a big resource drain to put it on event tick. I recommend something like this:

On Event Tick, get all the enemies in the level (you can substitute this for your pre-made array of qualifying actors), get the length of said array, and see if it equals zero. If that’s true, then open the door. Now that I think about it some more, I’d probably put a Gate just after Event Tick and close it once I open the door, just so it doesn’t keep trying to execute once it’s done its job.

If you wanted to avoid Event Tick, I suppose you could add each enemy to an array at Begin Play and then remove them as they die (by pulling off the array and choosing “Remove”). Immediately following that, you’d check the length of the array, and if it’s zero, open the door. However, I don’t know how to get the enemy blueprint to communicate with the Level Blueprint (where I presume you’d be opening the door) via its End Play event. I get the feeling, though, that Event Dispatchers could do the job, but I’m not familiar with them yet and so don’t know how I’d set that up.

I hope this helps.

Wait, here’s another option for you, and it avoids using Event Tick. Check it out.

Oh wow that might actually work! Thanks a lot Desann. Now I just need to create a kill function to test them out, but that’ll be something simple to do, thanks again!