How to trigger something after enemy dies?

So I have my set up to spawn in 3 enemy AI’s during a cutscene. And in that process I have a barrier that spawns around everyone with a blocking volume. So what I need is know how remove the barrier and blocking volume AFTER the enemies are defeated. Basically how it is in the Devil May Cry games. I’m not sure how to start this process.

Can someone explain how to get this started?

You could call in your effect right before you destroy your enemy actor? Is this going to be taking place during a cutscene or gameplay?

Create a Boolean variable in your Enemy BP Called IsDead.
Then have whatever leads to death set it to true , Like if health value is lower than 1 set IsDead to TRUE.
then create a branch condition that if IsDead is true then connect whatever you want to happen aftert the players Is dead to the true pin

You can do this in different ways:
for example, you can check how many enemy class left each time when you destroy/kill enemy. Use Get All Actors of Class -> length and if it returns 0 that means you defeated all enemies.
This will work if you destroy enemy object when they are defeated. If you do not destroy them, you can manually count them (for example, in your foreach loop count only dead enemies - where Boolean isDead is true).
Just create some generic function that will perform this check.

Awesome thanks. I’ll have to try these out. Haven’t done anything with enemies until now, let see how it goes.

So I tried using the “Get all actors of class” and “length” and I believe I am not using it right since nothing is happening. And for some reason I can never get a branch to work properly unless I follow a tutorial. If you can set up a BP showing how it to use the get all actor node it would be greatly appreciated.

So I have the block volume and the barrier effect appear during a cutscene and then after all 3 enemies are dead have the block volume and effect be destroyed. I don’t think I’ll do a cutscene for that part, but set pause and have text pop up.

You will need an List for this.
Lists are like arrays, but are mutable, meaning you can add and subtract from them running runtime.

  • The List should be on an object that’s in the game all the time, either an actor or game mode.

  • Once the player activates a trigger,

  • it activates the barrier

  • spawn the AI, with a BeginPlay that adds itself to the List by calling the List’s Custom Event

  • Once the AI dies, it calls a different Custom Event on the List. That Event should evaluate every time it’s called if the List size is <= 0. If so, then deactivate the barrier.

Simple really.

A lot of the stuff I know is by trial and error, if I go to YouTube it’s to learn the basic of how to use a node or I read into the docs to see if I understand it. But like I said in the beginning, this is my first go in doing something with enemies. Plus there’s normally really basic stuff that’s on YouTube and don’t help much that I find anyways. And honestly, I haven’t even thought about checking the templates, been trying to do it on my own to learn, I should probably start looking into them. And I didn’t even think about using Multigate.