How do I remove just one child from horizontal box?

I have a non-stackable pickup in my world. That means every time I pick up one item, a new slot appears in the horizontal box of the inventory widget (all slots are the same widget since it’s related to a specific item, think 5 apples).

However, I tried every combination of child removal, and always end up with the same result: If I have one item in the inventory, it disappears just fine when used, but if I have more than one, they all disappear when clicking on one of them. Is there a way to remove just one of the duplicate child widgets?

Can you show me how you are creating the duplicate child widgets?

Sure! This is the code from my pickup. Each time an item is picked up, this happens:

…and this is the “add icon and count” function.

And finally, my current child removal. This actually doesn’t work at all, the item is removed from the array, but the widgets stay as they are, they are not removed.

Hey sorry for the late reply, but you need to have some reference to the widget you’re removing or the index you’re removing it from. If the inventory array matches your inventory widget then i suggest using something like this

1 Like

I also recommend adding a “Current Inventory Slot” variable to your items struct to keep track of your items, could be -1 if the item is out in the world and not in your inventory.