# For Loop With Condition and increment/decrement

**URL:** <https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951>\
**Category:** Blueprint\
**Tags:** for-loop, unreal-engine, question, Blueprint\
**Created:** [October 10, 2016, 10:16am UTC](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951 "2016-10-10T10:16:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EXCIR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EXCIR](https://forums.unrealengine.com/u/EXCIR)\
**Post date:** [October 10, 2016, 10:16am UTC](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951/1 "2016-10-10T10:16:00Z")

</div>

Hey.  
I’m trying to make a macro for loop with **condition** and input for selecting **increment or decrement index value**.  
it doesn’t work at all. launching the macro cause system freeze and crash the unreal Play mode.I can’t see any logical problem. what’s wrong with my macro?

Thanks

 ![110269-macro.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/8/8/0885a131c53f9129726abf81fd6bc0d7bead7372.jpeg)

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [October 10, 2016, 12:56pm UTC](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951/2 "2016-10-10T12:56:23Z")

</div>

Try to debug with break points (right click node and there should be “add break point”) and check if all pins act as you expect (you can check state of pin by hovering over it during break) see if loop finishes.

Freeze most likely happens due to infinite loop, if you loop blueprint you stop the rest of engine (this includes editor) code from execution. but still it’s weird Blueprint VM has a protection for infinite loops (i think when it detects 10000 loops) so it is potential bug, but first confirm if you get infinite loop

---

<div class="post-metadata">

**Author:** ![EXCIR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EXCIR](https://forums.unrealengine.com/u/EXCIR)\
**Post date:** [October 14, 2016, 11:07am UTC](https://forums.unrealengine.com/t/for-loop-with-condition-and-increment-decrement/372951/3 "2016-10-14T11:07:53Z")

</div>

Thanks, . I couldn’t fix the issue, so made decremental “for loop” and did what I intended to do.
