Hi all
I’ve looked around the web and found some old code but since Unity has changed, I wanted to find out the best way to generate random scenes within Unity 5.
It’s a platform game and I wanted to make 20-30 small scenes that could be picked at random as the player progresses.
Any suggestions on the best practice and code for making this happen please?
Lets say you have 30 scenes. Call them something like scene1, scene2, scene3 all the way up to scene30 and just call a simple method:
int randomScene = Random.Range(1, 30); //gives you a random number from 1 to 30
Application.LoadLevel(“scene” + randomScene.toString()); or SceneManager.LoadScene(“scene” + randomScene.toString());