# How to "Loop" Int in a range. Blueprint

**URL:** <https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408>\
**Category:** Blueprint\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [July 30, 2023, 3:20am UTC](https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408 "2023-07-30T03:20:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bostonDownamics](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bostonDownamics](https://forums.unrealengine.com/u/bostonDownamics)\
**Post date:** [July 30, 2023, 3:20am UTC](https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408/1 "2023-07-30T03:20:41Z")

</div>

Ok, so what I’m trying to do is to get the length of an Array, pick a random position and then start a Loop from there.  
I would be something like this:  
(If I start on **5** )  
[1, 2, 3, 4, **5** , 6, 7] (It’s really hard to see but the highlighted number is 5)  
[1, 2, 3, 4, 5, **6** , 7] (6)  
[1, 2, 3, 4, 5, 6, **7**] (7)  
[**1** , 2, 3, 4, 5, 6, 7] (1)  
[1, **2** , 3, 4, 5, 6, 7] (2)  
[1, 2, **3** , 4, 5, 6, 7] (3)  
[1, 2, 3, **4** , 5, 6, 7] (4)

So it starts at **5** , goes all the way around and ends in the number before the starting one ( **4** ).

---

<div class="post-metadata">

**Author:** ![pezzott1](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pezzott1/32/1215068_2.png) [@pezzott1](https://forums.unrealengine.com/u/pezzott1)\
**Post date:** [July 30, 2023, 5:06am UTC](https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408/2 "2023-07-30T05:06:27Z")

</div>

This should do it:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/d/1/1d12b25287dda79a97bef67c6ec05471e2178ed4.png)

---

<div class="post-metadata">

**Author:** ![bostonDownamics](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@bostonDownamics](https://forums.unrealengine.com/u/bostonDownamics)\
**Post date:** [July 30, 2023, 6:36pm UTC](https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408/3 "2023-07-30T18:36:23Z")

</div>

Ok I see, you use the modus node

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [August 29, 2023, 6:36pm UTC](https://forums.unrealengine.com/t/how-to-loop-int-in-a-range-blueprint/1244408/4 "2023-08-29T18:36:29Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
