Moved my inventory items to new Resources Folder

So I moved my inventory scriptable objects to a new Resources folder under my personal GameDev assets folder. The Folder is named as ‘Resources’. But the inventory system is not detecting the items

image

This should be fine if you didn’t change the Resources.LoadAll("") bits. How are you loading these? Did you specify the path? And if you did, did you spell it correctly? Because the path in the screenshot has a typo

how do I mention the path ? and what is the typo ?

If you don’t know, then I guess you didn’t, Where we load assets with Resources.LoadAll("") you would give it the path. The path is relative to the Resources folder, so in your case it’s still “”

It says GameAssests which should in all likelihood be GameAssets

You say you put them 'under my personam GameDav assets folder`. Is this folder still in the project’s ‘Assets’ folder?

yes

image

Yeah, that should work. Perhaps Unity needs to rebuild something. I would suggest restarting Unity

The Inventory system actually gets the items using Resources.LoadAll<InventoryItem>("");

These are then stored in a Dictionary at runtime organized by the ItemID. Make sure that each item has a unique item ID.

Privacy & Terms