Created
July 18, 2022 21:19
-
-
Save aprilspeight/f7eec05520383733d0cbcf6adc91f061 to your computer and use it in GitHub Desktop.
Instantiate a prefab at a specific position.
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 a specific position with no rotation | |
Instantiate(prefab, new Vector3(2, 2, -2), Quaternion.identity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment