The hotbar assignment remains the same when I discard the item.

misottyo

New member
Thank you very much the other day!

I have one more question.
If you discard an item, the reference to that item's hotbar remains.
Items cannot be used. Only the image remains.

Can I reset the hotbar status to empty if I throw away the item?

version of unity
2021.1.21f1

UIS version
1.2.2
 
This is by design, if you check the demo you'll see that the icon is greyed one once completely used. That's because the hotbar is remembering where you added items, so once you pickup the item again, it will try to add it back in that slot automatically. Instead of greying out the icon you could make it transparent by changing the color multiplier used in the ItemViewModule. Check the Demo Hotbar ItemView prefab.

I usually recommend people to create their own custom hotbar script such that it can work exactly like they want, all hotbars work differently, and in many cases you have more than just items in hotbars.

Our focus was on having a basic hotbar which uses inventory referencing and another hotbar (the equipment window, aka ItemSlotCollectionView) which moves the item into another collection. Refer to the Hotbar Feature scene which explains the difference between the two and how to set them up
 
Top