Created
July 18, 2022 21:17
-
-
Save aprilspeight/04a9af1f5119b798c2d50b9c4362ab8e to your computer and use it in GitHub Desktop.
Instantiate a prefab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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