How to keep track of enemy death

Hello,

I am trying to set up a spawning wave system and in order do to that I would need to set up a system that keep track of the number of death of enemies. So far I have a system that work using integers and implementing the integer (+1 )everytime an enemy dies.

The system is based of the toturial to spawn.

  • I have one spawner with a custom event called spawning. It has a timer by function executing the spawning function and spawning ai at a location with a define number of enemies.
  • The game mode (event begin play) execute a function getting all the spawner and telling them to execute the function spawning with a timer
  • The ai character calculates damages and fires an death count with an integer created inside the game mode and implements it
  • The game mode check if this number of death equals number of enemies and if yes - will fire second wave.

I am wondering if there is a better way to go using arrays to keep track of number of death. I tried to use get actors from class - length - remove from index but did not seem to work.

If anyone has done that before or knows a better way to do that is modular and easy to use for waves?

Thanks again

here are the screenshots