Forum begins after the advertisement:
-
::Help! I found a problem with my ‘inventoryType’ as my editor stating it does not exist. It was located in InventoryManager.cs and this is the code.
if(inventoryType == InventorySlot.InventoryType.Item)
{
//Iterate through each inventory slot and find an empty slot
for(int i = 0; i < items.Length; i++)
{
if(items[i] == null)
{
//Send the equipped item over to its new slot
items[i] = equippedItem;
//Remove the item from the hand
equippedItem = null;
break;
}
}
}
And I already write it in InventorySlot.cs here:
//Determines which inventory section this slot apar of
public InventoryType inventoryType;
::Hi Ondra, you also need to declare the InventoryType enum before the variable, as the variable is using the InventoryType enum.
Something like this:
public enum InventoryType { Item, Tool }
public InventoryType inventoryType;
You have to check the video again to see what all the InventoryType enum options are. I might have forgotten some.
::Thanks. It’s already solved!
Advertisement below: