Multislot Inventory UNITY3D

broken image

I hope this course will be useful for you. This course includes: Item take and drop, drag and tooltip, search container, use item, save & load manager and more mechanic. I'd be happy to chat more or explain, if I can help. At the end of this course, you will develop an inventory system like the Escape From Tarkovs inventory system. I only had a list of slots in my inventory, and each slot was either an item (scriptable object) or null. I never kept a list of items, I don't think. It's in 1 of the threads I made, if you were ever interested in looking at it. My code had partial moves, and stacking, too. Otherwise, if valid and not empty, temp variable for old, old slot = current slot, current slot = temp. If slot is empty, assign item and update the visual content of old + new In your situation, I guess that would something like:

broken image

Then, check if the slot is a valid location, and call a method to do the assignment.

broken image

Trying to offer a summarized version: If you use the 'slot' as the dragged item, you can have access to the item the slot contains when you drop it in its new slot. I looked over the code I wrote, but haven't touched or read in months.

broken image