I can’t thank you enough!!! Really! Here is what I could do with all your help!!
I’ve used second method since it is easier !
I had a problem where after Items were deleted and put to last slot, when I picked up the same Item again it was appearing in random place because references were taken from ‘Inventory slots’ array And I couldn’t use wrap box array, I tried to get around using additional integers but after some time came up with this final result!! This works fine for me in vert aspect!!! I don’t know if it’s optimal (don’t think so actually) but deleting unused slots appeal to me and I think it’s the best choice! Here is how it all looks now
I start with 0 slots and add them on demand checking if there are any available slots
After Item is depleted I call a dispatcher (didn’t even know about it) I didn’t know how to make a reference from slot to inventory since adding inventory variable to slot widget didn’t work and tried making a bridge through main character but seems that dispatchers are better
So after dispatcher is called I remove slot from array and also from parent ( I don’t know if removing from parent removes it from widget fully, If it does not I’d like to know how but couldn’t find much)
That’s all! Works perfectly. Thank you so much, I learned a lot!! Could you please tell me if this code and logic is usable and not perfomance heavy?
Thanks !!!