Hi!
I would like to get some help. I have been trying to implement multiple inventory’s in my game. I would like to have a different inventory for different item types (Currently 3 types).
I have followed the inventory course offered on Udemy and still have the same mechanics as in the course but with some minor tweaks.
Currently I seem to have it partially working. I have created 3 different inventory’s. When the player picks up an item it goes in the correct inventory. But when I drag & drop items from any where to their inventory the item always spawns in the first inventory I have created.
Here is a pic of what I am trying to do
Like mentioned I have 3 inventories (Mask, M-components, Materials). Currently, when I pick up items they spawn in the correct inventory. But When I drag & drop from Gear to the inventory’s or change an item slot to another slot within the same inventory, the Item is always spawned in the first inventory(Mask) no matter what.
These are the inventory scripts on the player:
Since all inventory’s have the same name I made a InventoryPlayerList script just to have a reference of my inventory’s for easier access.
Item category’s are made with an enum in the InventoryItem Script:
public enum ItemCategory
{
Mask,
MComponent,
Material
}
public abstract class InventoryItem : ScriptableObject, ISerializationCallbackReceiver
{
protected ItemCategory itemCategory = ItemCategory.Mask;
public ItemCategory Category => itemCategory;
public ItemCategory itemCategoryType;
My guess is in the dragItem script, in the GetContainer Method, I would have to find some way to change the IDragDestination that is in the container. But I may be wrong on that one.
Let know if there are any script or other you would like me to share. I will be glad to share!
Thanks in advance!
Cheers,