Create and Name a new scene through the script.

Hi, I’ve been working on my project for a few weeks now and starting to get to some meatier items.

I have a solarsystemgen script. It generates a star, planets and gives them rotations and orbits. I need to reuse this script to make more solarsystems in case the player travels out from the starting solarsystem. I need to make two scenes per planet generated. Since there is a random chance of spawning a planet (thats how ive setup the code) it is important that the script checks to see if a planet was made and if so then make a newscene, name it, apply it to the Build Settings → Scenes in Build, and then make it run its own stuff.

Im not familiar with the static void NewScene(); it needs a return type which I cant find what it is. It says game object but when I try variations of gameObject it still gives an error.

Any suggestions?

Thank You

You can’t make new Scenes at game runtime. If you need to create other planets, you need to create them in the same scene and then move the player to the new location and then delete the old planets if you don’t need them anymore