Blueprint spawning issue - infinite loop

Hello -
I’ve created this little BP script that will spawn a zombie at a random target point up to 2 zombie then will keep checking how many are left until there are zero. Once there is zero left, it will respawn 2 more. For some unknown reason, when I attempt to play the game I get an error that the while loop in the “CheckEndOfWave” event is an infinite loop, but I can’t figure out why. Any help would be greatly appreciated. Thanks!

Hey WhiteRook,

In the “CheckEndOfWave” function/event you have to replace the loop with a branch, and then everything should work fine :slight_smile:

Good luck!

Thanks, Elias. You were right. I actually replaced both While Loops with Branches. This also allows me to put a Retriggerable Delay before the branches, thus allowing me to control how often it checks for enemies still alive and also how fast the AI spawns.