# How to decrement in For Loop with break

**URL:** <https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969>\
**Category:** Programming & Scripting\
**Tags:** for-loop, unreal-engine, loop\
**Created:** [May 27, 2024, 8:18pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969 "2024-05-27T20:18:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jil3R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jil3R](https://forums.unrealengine.com/u/Jil3R)\
**Post date:** [May 27, 2024, 8:18pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969/1 "2024-05-27T20:18:28Z")

</div>

Hello all,  
so after so many attempts, I could create a decrement for loop using unreal engine. so here is the blueprint screenshot. we can give the first index and last index. I have also added a delay and break also. I had to create this as a macro.

 ![DecrementForLoop](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/6/7/9673e121d1a2fe0c3f09f5ea2329a247b9bca2ed.png)

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [May 27, 2024, 9:04pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969/2 "2024-05-27T21:04:51Z")

</div>

Hey @Jil3R!

Your image didn’t post! ☹ Try editing the post and reuploading the image. Make sure to wait until it’s confirmed!

We’ll check back in a bit!

---

<div class="post-metadata">

**Author:** ![Jil3R](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jil3R](https://forums.unrealengine.com/u/Jil3R)\
**Post date:** [May 27, 2024, 9:19pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969/3 "2024-05-27T21:19:01Z")

</div>

Hi @Mind-Brain ,

can you check now

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [May 27, 2024, 11:09pm UTC](https://forums.unrealengine.com/t/how-to-decrement-in-for-loop-with-break/1875969/4 "2024-05-27T23:09:36Z")

</div>

Hey, great!

Maybe you should look into adding it publicly to the snippet repository!

> **[Code Snippet Repository for Epic Developer Community](https://dev.epicgames.com/community/unreal-engine/snippets)**
>
> Snippets are chunks of previously authored code or script (C++, blueprint, material graph etc.)you can use to improve and expand your Unreal Engine project.
