Infinite loop, blueprint for loop

My game keeps crashing because it is detecting an infinite loop in this function within the level blueprint. Any help would be great.

Gameplay code in UE4 is not parallel, if you loop you prevent rest of the engine and gameplay code from execution, thats why there infinite loop protection in blueprints, in C++ there is not and if you would do the same there you would freeze engine.

Use Tick event insted, Tick is called on every frame, it’s event to update state of object for every frame. Your code seems to check some state, so check that state on every frame.

In your case if you make wave kill detection, this can be done without Tick (and avoid use of unhealthy “Get All Actor Of Class” on every frame), make a counter of enemies and when one is killed make it tell some class that it been killed to lower the counter, on each kill register call you check if counter is 0, if it is you start another wave

Also this kind of code you making should be in GameMode class not level blueprint, level blueprints is hard to communicate with from other blueprints and it was made primery for level scripting not gameplay code