Home

Published

- 1 min read

load prefab in script unity

img of load prefab in script unity

The solution for this is noted below

load prefab in script unity

Solution

   /*
To use Resources.Load,
the object must be in a Resources folder.(there can be multiple).
So your folder structure could look like "Assets/Resources/Prefabs/prefabName"
Then to load it use*/
Resources.Load("Prefabs/prefabName") as GameObject;

Try other methods by searching on the site. That is if this doesn’t work