Destroy spawned enemies

EndPlay event on spawner should be called automatically when the level streams out, so you shouldn’t need to call it from a trigger. And, yea, whenever spawner spawns a pawn, add the reurn value from the spawn actor node to a variable.

Then on spawner’s EndPlay, check if pawn is valid (and any other conditions you want to compare), then destroy it. Naturally, you’d do this in a foreach loop if you have an array of actors as the reference variable.

The main part of my spawn function looks like this:

With a bit of extra logic after that to call a function on the pawn to setup the appearance/gear/etc… and also sets a ShouldSpawn bool var to false.

The quest stuff on the first 2 branches are just checking whether the player is on or finished a certain quest set in another var somewhere.

On begin play and every 2 seconds, I check if ShouldSpawn is true and call the function.

Cleanup is like so:

PawnDied event is called via interface from the pawn when it dies so they’ll respawn. Ignore the set text bit, that’s just for a debug label floating above spawnpoint.

The follower bool is a bit of a hacky way to make bodyguards/pets not despawn when the spawner streams out.