Looking to spawn waves of enemies, where each enemy has a spawn delay. The enemy type and spawn information comes from a table.
Right now I can only spawn all the enemies of a wave at the same time. I tried to use timers unsuccessfully.
I tried to use “Set timer by event” but it doesn’t allow parameters so when the timer goes off the event won’t know which enemy to spawn.
I tried spawning all the enemies of the wave and added a delay in the enemy blue print on “begin play” but the behavior trees are still active during the delay so that doesn’t work.
The only solution I can think of is this:
- loop through all enemies in wave
building a queue of enemies from
smallest to largest delay - set timer to first enemy in queue
- when timer goes off spawn all enemies in front of queue with same spawn delay. Dequeue spawned enemies.
- set new timer to next enemy in queue
Seems like there should be a simpler solution.