Unity2D Instantiated Prefab Won't Appear in Scene

In our game, we have a prefab we want to insert into the scene in a C# script. It works fine when dragged and dropped into the script, but when we use this code:

GameObject prefab = Resources.Load<GameObject> ("Prefabs/StarDude");
Instantiate (prefab, new Vector3(0f, 2f, 0f), Quaternion.identity);

Then nothing appears in our scene when we run it. This is code is in the start function of a monobehaviour, could this be the problem? Can it not add to the scene while starting up? Should anything be appearing in the hierarchy when we run the game? Or are we missing something simple? We also tried making a public variable for the prefab and setting it in the inspector, and this didn’t work either. Any help is appreciated.

Is the “Prefabs” folder located in a folder called “Resources”? Resources.Load can only load objects that are located in a Resources directory.

Loads an asset stored at path in a Resources folder.

Documentation

Also, all prefabs have a suffix of .prefab so you should be loading StarDude.prefab instead of StarDude.