Hi, I have a blueprint in my game that spawns other blueprints inside it after another event has happened. I have put a lot of these in my scene. However, when I add one too many (this number is the same every time) I suddenly get a infinite loop error. I cannot find any place where this loop would occur and I find it strange that it only happens at a certain limit. Any ideas about what is wrong? Is it too much spawning at once?
Hi, I’ve also encountered similar issues in the past. Though it would be helpful if you could give more info
So my game mode class needs to load in some info that the problem blueprint (A) needs to be able to spawn the other blueprints, it does this on begin play. When it is complete it dispatches an event to A that it can start spawning. Each A spawns about 50 other blueprints. When I had around 215 A’s in my scene it was working just fine, but 216 was when I got an infinite loop error. The call stack shows that this error occurs in the middle of the spawning process, where I am accessing the info from the game mode class. Let me know if you need more info!
I learned from my own experience that the engine indeed sometimes gives the infinite loop error when the iteration exceeds a certain workload limit. If the issue occurs without changing any other parameters other than the number of iterations, that’s probably what’s going on. However to make sure, you can send your blueprint code.
There is a setting in project settings called Maximum Loop Iteration Count that is default 1000000. Try raising it to rule it out.
Sometimes the engine will give that error if it’s executing for too long in a blueprint regardless of how many nodes there are. You can try adding some delay until next frame nodes to see if that helps when iterating. If not, you may have to split it up and do a bit each time in your Tick event.
Yes, it worked after raising that number! Thanks, I’ll look through my code to see if I can decrease my loop count