# Remove object from array after it got haunted

**URL:** <https://forums.unrealengine.com/t/remove-object-from-array-after-it-got-haunted/2232994>\
**Category:** Editor Scripting\
**Tags:** unreal-engine, question, Blueprint\
**Created:** [December 20, 2024, 2:02am UTC](https://forums.unrealengine.com/t/remove-object-from-array-after-it-got-haunted/2232994 "2024-12-20T02:02:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MRCOFFIN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mrcoffin/32/1010534_2.png) [@MRCOFFIN](https://forums.unrealengine.com/u/MRCOFFIN)\
**Post date:** [December 20, 2024, 2:02am UTC](https://forums.unrealengine.com/t/remove-object-from-array-after-it-got-haunted/2232994/1 "2024-12-20T02:02:36Z")

</div>

I’m trying to make some items haunted and after an item get haunted i want it to remove from the array so the same object wont be selected again .

Setup is like this

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/e/36e4c30d11ff944a8a73b402f1f6ccddae3dde78.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:** [December 20, 2024, 8:45am UTC](https://forums.unrealengine.com/t/remove-object-from-array-after-it-got-haunted/2232994/2 "2024-12-20T08:45:38Z")

</div>

The problem is, you’re calling the GET 3 times

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/7/5977f7b821422b37b7375f930f2d00f93a36217a.png)

and each time, you’re getting a different random int.

If put the int in a variable ( so its fixed ) and the do the rest of the code, it will stay the same.
