Setting Prefab with Code Returns NULL

Ok I am going crazy how come none of these work? I am trying to make a the GameObject prefab to set to a prefab that I want. So I can later place that block.

prefab = (GameObject)Resources.Load(“Objects/Blocks/Dirt”) as GameObject;

prefab = (GameObject)GameObject.Instantiate((GameObject)Resources.Load(“Objects/Blocks/Snow”));

prefab = Instantiate(Resources.Load(“Resources/Blocks/Dirt”, typeof(GameObject))) as GameObject;

All return null!

After doing this I then do Instantiate(prefab, G, Quaternion.identity); which works fine but only does it when I drag object to prefab in editor. This can’t happen since I need to switch the prefab to other types of blocks.

Because Resources.Load() very specifically says your files have to be in “Resources/” folder.

Also, any reason why are you loading them from resources rather than having a reference to your prefabs from the script? Is it only ever used once?

Why you dont try to make a List ?

public List<GameObject> mylist;
prefab = (GameObject)Instantiate(mylist[index], G, Quaternion.identity);