Skip to content

Instantly share code, notes, and snippets.

@aprilspeight
Created July 18, 2022 21:17
Show Gist options
  • Save aprilspeight/04a9af1f5119b798c2d50b9c4362ab8e to your computer and use it in GitHub Desktop.
Save aprilspeight/04a9af1f5119b798c2d50b9c4362ab8e to your computer and use it in GitHub Desktop.
Instantiate a prefab.
// Assign the prefab in the editor
public GameObject prefab;
void Start()
{
// Spawns a prefab at the default position 0, 0, 0 with a default rotation 0, 0, 0
Instantiate(prefab);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment