# \[Bug\] Blueprints Forloops infinite loop detected

**URL:** <https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 8, 2014, 11:21am UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944 "2014-12-08T11:21:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hevedy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hevedy](https://forums.unrealengine.com/u/Hevedy)\
**Post date:** [December 8, 2014, 11:21am UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/1 "2014-12-08T11:21:53Z")

</div>

If add 6 Forloops ( from 0 to 20 for example )one each other engine return “infinite loop detected”.

---

<div class="post-metadata">

**Author:** ![eXi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/exi/32/906583_2.png) [@eXi](https://forums.unrealengine.com/u/eXi)\
**Post date:** [December 8, 2014, 12:04pm UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/2 "2014-12-08T12:04:08Z")

</div>

Hey,

would you mind posting a picture of the setup?  
Does this appear in a new project?

---

<div class="post-metadata">

**Author:** ![Zeustiak](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zeustiak](https://forums.unrealengine.com/u/Zeustiak)\
**Post date:** [December 8, 2014, 12:12pm UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/3 "2014-12-08T12:12:52Z")

</div>

Go into Edit\>Project Settings\>General Settings\>Blueprints\>Maximum Loop Iteration Count

That sets the number of iterations you can run before it calls the infinite loop, and the max is ~2Billion.

Note that this is iterations, which I believe is just about anything that happens inside an execution such as Get, Math, etc.

Anyway, 20^6 is about 64 million, so you should be able to run that with a limit of 2 billion assuming you keep the actions inside the loop to less than ~30 iterations per execution and also do nothing else in the entire blueprint. If you need more than that you are going to need to find a way to split your loop up or download Rama’s Victory Plugin which has a node that can break the limit counter mid-stream.

---

<div class="post-metadata">

**Author:** ![Hevedy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hevedy](https://forums.unrealengine.com/u/Hevedy)\
**Post date:** [December 8, 2014, 1:06pm UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/4 "2014-12-08T13:06:07Z")

</div>

Wow thanks now is fixed.

---

<div class="post-metadata">

**Author:** ![Hevedy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Hevedy](https://forums.unrealengine.com/u/Hevedy)\
**Post date:** [December 8, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/5 "2014-12-08T13:07:38Z")

</div>

Is a simple blueprint with 6 ForLoops but in this case is 3 ForLoops Calling a subclass with other 3 loops.

---

<div class="post-metadata">

**Author:** ![atlasan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@atlasan](https://forums.unrealengine.com/u/atlasan)\
**Post date:** [June 24, 2021, 7:20pm UTC](https://forums.unrealengine.com/t/bug-blueprints-forloops-infinite-loop-detected/300944/6 "2021-06-24T19:20:41Z")

</div>

Oh @Rama, love u. Thank you @Zeustiak very useful.
