Skip to content

Instantly share code, notes, and snippets.

@aprilspeight
Created July 18, 2022 21:19
Show Gist options
  • Save aprilspeight/f7eec05520383733d0cbcf6adc91f061 to your computer and use it in GitHub Desktop.
Save aprilspeight/f7eec05520383733d0cbcf6adc91f061 to your computer and use it in GitHub Desktop.
Instantiate a prefab at a specific position.
// 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