I'm making an RPG and am currently hung up on making the inventory system.
I'm trying build the system off a tiled background as containers will vary in shape and size, and I want the accessible inventory space to reflect that. The display aspect is working fine, it is the actual inventory system that is giving me trouble.
The first problem is that when adding new items to the inventory, I don't know how to make the system aware of which slots are available, so all the icons just pile up in the first slot.
The second problem is that when moving inventory items around I don't know how to get them to snap to inventory tiles. I know there is a way to grid snap, but I don't know how to make it relative to the inventory slots especially since the inventory windows are meant to be moved around freely.