just to organize things, in my case i created a “Spawner” blueprint, i created an event to spawn enemies in this BP, then i put a lot of spawners in the world, and store a reference to the blueprint that is going to spawn them, in my game, i’m not using a wave system, so i put the reference to the spawners in trigger box around the world, so when i hit the trigger box i spawn enemies (that’s not helping counting the enemies yet, but i will get there)
this is what the details panel show in the world, here i can control how many enemies of each class will spawn:
and this is how i call the event. the rate multiplies the value of each enemy from the details panel, so you can set it to 2 if the player choosed to play in “hard” for example and easily double the number of enemies.
and at last, i would recommend you spawning the enemies from the “GameMode” instead of spawning from the level BP, the reason is: if you want to create a new map you could use the same game mode and everything would still work, and it’s easier to get a reference to the game mode.
TO THE POINT:
after spawning the zombies you could create a loop with break: with “get all actors from class” in case you have created a parent class to all enemies that stores the HP, then get their HP, if the HP >0 break and delay 1 second, then go back to the “get all actors from class node”, if you get to the end of the vector it’s because all enemies are dead (got HP<=0), and you can spawn a new wave.
in case you don’t have a parent class like i said, you can also do something different, you would need to destroy all the enemies when they die, and add a tag to all of your enemies, then use the same loop system with “get all actors with tag” so if the array is empty, it’s because all the enemies were destroyed and you can spawn a new wave, if there’s something in the array, it’s because there are still enemies alive, then go back to the “get all actors” node.
another option, put the spawning code in the gamemode, and create a variable and an event called “enemy down”(or something like this, i’m not good with names), every time an enemy is spawned you increase the variable, then, in the enemies code, you have to do a check every time your enemies take damage, if they died you get a reference to the game mode(you can get the reference with “get game mode”, you will have to cast to your game mode class after ir), and then call the “enemy killed” event, the “enemy killed” event should decrese the variable you created by 1, and if it’s=0 it call’s the new wave.