# Boolean before destroy actor and remove index

**URL:** <https://forums.unrealengine.com/t/boolean-before-destroy-actor-and-remove-index/306497>\
**Category:** Editor Scripting\
**Tags:** bool, inventory, unreal-engine, Array, question, Blueprint\
**Created:** [February 10, 2015, 3:50am UTC](https://forums.unrealengine.com/t/boolean-before-destroy-actor-and-remove-index/306497 "2015-02-10T03:50:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdmoberly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdmoberly](https://forums.unrealengine.com/u/mdmoberly)\
**Post date:** [February 10, 2015, 3:50am UTC](https://forums.unrealengine.com/t/boolean-before-destroy-actor-and-remove-index/306497/1 "2015-02-10T03:50:08Z")

</div>

Good evening! (This example is based off the [UMG Inventory tutorial][1] on YouTube) I am attempting to preform a boolean check before removing “Inventory Slot” from array index.

I tried creating a bool “ItemUsed” to be set on the BP\_Pickup. Then placed a branch to check that bool before “remove index” in GameHUD to only remove the Inventory Slot if bool: ItemUsed was true. That did not work.

Should I be calling “remove index” from BP\_Pickup? I’ve tried a few different things with no luck. Below are the two blueprints before my boolean modifications… I’m stumped.

GameHUD

 ![29473-gamehud.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/7/9/b79c2e0a26f3a449853c7b30a8e4ff850a5ed567.png)

BP\_Ammo\_Pickup

 ![29474-bp_ammo_pickup.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/0/090c77346f6367e97586fe914e7ab752898239d0.png)

Any advice would be awesome!  
Thanks!

---

<div class="post-metadata">

**Author:** ![mdmoberly](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdmoberly](https://forums.unrealengine.com/u/mdmoberly)\
**Post date:** [February 11, 2015, 8:55pm UTC](https://forums.unrealengine.com/t/boolean-before-destroy-actor-and-remove-index/306497/2 "2015-02-11T20:55:10Z")

</div>

Solved this… I was setting “ItemUsed” before I set “CurrentAmmo”. I set “ItemUsed” after set “CurrentAmmo” and it worked.

if anyone has any pointers, feel free to shine in! Thanks!
