Create an automatic enemy wave

I was able to stop all waves from spawning simultaneously by setting the number of Enemy1 living on the scene = 0. But that doesn’t work if there are other Enemy1’s on the level that aren’t part of the waves. You’d have to kill every single Enemy1 instance on the level. I want the waves to only be changed based upon dead Enemy1’s in the wave not every single one in the scene.

You could add a variable to the enemy1 object to keep track of which wave it belongs to.

Keep track of the number of enemy1 objects spawned for each wave in a structure (use the wave number as the structure child).

When you kill an enemy1, decrease the structure value for that wave by 1. If it’s 0, then all enemy1 objects for that wave have been deleted.

Thank you MrMen.
I added a variable number ‘WaveEnemy’ to the Enemy1 object, and created a Structure called ‘WaveCounts’ with number children for each wave. But I’m confused what condition to add/change. I’m assuming I need to change the existing condition and not just add a new condition.
I was able to add a condition where the number of enemy1 in the scene equaled ‘WaveCounts.1’ child. But that doesn’t make it advance once the enemy is dead. It only spawns the first wave. So I know this isn’t right.

I’m waay over my head and I obviously have something broken in my event sheet. lol


Can you screen snip what you’ve done so far? The screen snips you’ve provided don’t show anything other than the first wave, and nothing of the new variables you’ve created.

Of course, and again thanks for the help:








  1. Stop using repeat for each enemy1 with a check for the state. Use an event for each check enemy1 state and the repeat for each enemy1 as a subevent of each of those.

  2. What state do those “Enemy1 death” events belong to? The events for each enemy1 state should be changing the state, unless it’s something that applies during every single enemy1 state.

  3. In these events:

  • add a Trigger once while true at 1, otherwise the whole block of events will get run every game frame, and with only 3 waves defined, it’ll be over faster than you can blink.
  • The action in 2 will ensure 3 never succeeds while WavesToSpawn has children. the event at 3 needs to be moved as a subevent of the event where you reduce QueSpawn[0].

Thanks for the assist!

  1. Okay I’ll remove the repeat.
  2. Yeah good find, that was old left over before I started the state machine. I removed it.
  3. I did the change and moved the #3 to here:

    But didn’t seem to change it.
    Did I move it to the wrong location?

So still having issues with the waves not working. Just the first wave spawns. After killing them, no new waves spawn. But if I leave the spawn area and come back the 2nd wave spawns. Etc…