Infinite Loop in foreachloop
I'm having problems with an infinite loop being detected in my foreachloop, which I just can't understand how it becomes infinite. It's a foreachloop, fed an array from all actors of class where the maximum number should be 2000, rather less. In the foreachloop are only branches, nothing that could go on infinitely, by far not.
Does anyone see a problem within this script? Thank you for every helpful hint!
asked Apr 14 '18 at 06:10 PM in Blueprint Scripting
Based on what I'm seeing, you could just use a ForLoop instead, and set the Last Index to 2000.
I doubt the Counter is the real problem though. Base on what I'm seeing, I think it's being caused by the fact that you have one loop inside another loop, and the internal loop is being scaled inside the external loop. (Spawning object in first loop, then looping over the number of spawned objects inside that loop). It's difficult to see well enough what's going on to be sure, but that's generally a pretty messy and dangerous thing to do.
Would it be possible to just loop over all the objects after the first loop completes?
Follow this question
Once you sign in you will be able to subscribe for any updates here