Hello, I’m implementing an inventory system. I have a widget blueprint WBP_Inventory, which has a grid panel. The grid panel holds and aligns a kind of widget blueprint WBP_Item. When an item is added, a corresponding WBP_Item is created and added to the grid panel with the following logic:
When a WBP_Item is clicked, it should be removed from the grid panel. I tried to use this logic:
But it resulted in a broken display of my items. I was able to poke holes in the grid panel with my mouse!
I had to clear all children of the grid panel, and re-add items according to my array of WBP_Items:
This gives a correct behavior, where if an item is removed, every item after it will be pushed forward one slot.
I wonder if I’m doing something wrong here? Does anyone have a similar experience?
Note: Screenshots only reveal part of my logic. I believe my array is properly maintained.