Instantiating using a string for prefab name

I am trying to instantiate a prefab by using a string of its name. Like so:

Debug.Log(prefabName);
		planet = (GameObject)Instantiate(Resources.Load(prefabName));
		planet.transform.parent = transform;

the debug log i put in to make sure the name was correct. Am I right in thinking that the third line makes the instantiated planet become a child of the current object? Off topic question there but, the main problem is:

It is telling me “The thing you want to instantiate is null”. I have checked prefabName and it exactly matches the name of the prefab I want to instantiate, What am I doing wrong here?

Thanks in advance.

Resource.Load() only searches for assets in the Resources folder. Make sure that your prefab is actually located in that folder.

If it’s in Resources/something folder, then you’ll need to use Resource.Load("something/myPrefab");

You can have more than one “Resources” folders.

Most probably your prefab is not under Assets/Resources folder or its name includes file extension. Please check the Resources.Load documentation.

Yes - third line makes planet a child of current transform.

I FOUND FOLLOWING IN “Scripting API”

// Instantiates a prefab named “enemy” located in any Resources
// folder in your project’s Assets folder.

	GameObject instance = Instantiate(Resources.Load("enemy", typeof(GameObject))) as GameObject;