Hello Devs, I have a couple weird bugs with my inventory system that has me stumped. The inventory is a hot bar that contains three slots max. On the main bp I have an item count after an Item is picked up which adds 1. Then at the beginning I have a branch asking if the item count is equal to inventory space which the max for it is 3. This works perfectly until I added the drop system.
If I pick an Item up and then pick another Item up filling up two slots. For example, if I selected the first box (which it does it with any of the boxes selected) and I drop the item, I then have one item in my inventory that is in the second slot. If I, then go to pick up a new item it decides to move the second slot item to the third slot. If I repeated this again the item that is in the third would then disappear even if I had enough space in the first or second slot to hold it. If the item disappears after being moved to the third slot due to what I stated above it, then claims my inventory is full even though I have nothing inside.
What I would like help with achieving is after I drop an item it subtracts 1 from the item count and no matter what inventory slot, I have selected it will add the new item to whatever available slot there is that does not have an item in it without items moving slots and disappearing like what happens above and does not go past the maximum of 3 slots. Below I have all of the blueprints that should be needed to help figure out an error I made within my code.
Main Object Pickup Blueprint
Inventory Slot Selection Blueprint
Drop Item Blueprint
Remove Items Function within the Drop Item Blueprint