Classic: The prefab you want to instantiate is null. -.-

So this is the problem every time i hit play i get this error.
The prefab you want to instantiate is null.
this is the code:
var instance : GameObject = Instantiate(Resources.Load(“hatstorage/” + hat), bone.transform.position, bone.transform.rotation);

Ive already debugged and the hat is equal to tophat and my hat is dropped inside assets in the folder hatstorage and is named tophat. Although unity decides to give me a error. Please give me an explanation asap. This is really pissing me off.
If although you are skilled enough to give me an explanation(and helps me) i tip my hat and give you this very delicious digital Cookie. alt text

Thanks for reading and have a nice day! :slight_smile:

Description : Loads an asset stored at path in a Resources folder.

my hat is dropped inside assets in the folder hatstorage : your hat must be in a Resources folder. Create a folder, name it Resources

om-nom-nom