Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save openroomxyz/7b835efdbd23e48e58e42765b6f380e0 to your computer and use it in GitHub Desktop.
Save openroomxyz/7b835efdbd23e48e58e42765b6f380e0 to your computer and use it in GitHub Desktop.
Unity : How to Instantiate a prefab from resource folder, by name? [Works in Build and Editor! ]
GameObject my_game_object = (GameObject)Resources.Load("BIP", typeof(GameObject));
Instantiate(my_game_object);
Instantiate(my_game_object); //we can Instantiate the prefab many times and creates mane game object from it
my_game_object = null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment