# Random Int not selecting the same in a row

**URL:** <https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 21, 2023, 12:32pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477 "2023-05-21T12:32:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClassifiedFX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClassifiedFX](https://forums.unrealengine.com/u/ClassifiedFX)\
**Post date:** [May 21, 2023, 12:32pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/1 "2023-05-21T12:32:42Z")

</div>

I am not sure why this is not working. It still gives me the same objects twice in a row. Am I doing something wrong with these nodes?

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

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 21, 2023, 12:47pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/2 "2023-05-21T12:47:15Z")

</div>

RANDOM can return the same item more than once. If you want it to do each one once, you have to remove each index as you use them…

---

<div class="post-metadata">

**Author:** ![ClassifiedFX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClassifiedFX](https://forums.unrealengine.com/u/ClassifiedFX)\
**Post date:** [May 21, 2023, 1:18pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/3 "2023-05-21T13:18:33Z")

</div>

that is why I have those if statements in there. If I remove the items from the list then when the list is empty they all need to be added to the list again?

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 21, 2023, 1:40pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/5 "2023-05-21T13:40:48Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/8/b68259b2990c84ce9444500bd14baba9f7fec1f1.png)

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 21, 2023, 1:48pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/6 "2023-05-21T13:48:25Z")

</div>

Slightly more efficient

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/a/bca2599181ea8ea087444d1a0b9e4e9d5e8f818f.png)

---

<div class="post-metadata">

**Author:** ![ClassifiedFX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ClassifiedFX](https://forums.unrealengine.com/u/ClassifiedFX)\
**Post date:** [May 21, 2023, 2:24pm UTC](https://forums.unrealengine.com/t/random-int-not-selecting-the-same-in-a-row/1173477/7 "2023-05-21T14:24:53Z")

</div>

thank you man this will do!
