Random Scene Selection Upon Launch

So I want to manually build my endless runner levels. If I was to build 4 different levels. Would I be able to have the game choose one of the levels randomly each time the player restarts?

yes, just make a global variable and whenever player clicks restart button, change the global variable to random() and if global variable = 1, change to scene1
if global variable = 2, change scene to 2

You can bypass the global variable if you name your scenes scene1…scene4, and just use Change to scene "scene" + ToString(RandomInRange(1,4))

And if you have the same set of events for each scene, consider using external layouts.

1 Like

To do that upon launch, you can put that random scene change described by MrMen into an empty scene that you put at the top of the scenes list, and in all scenes at the end switch back to that scene. That has also the benefit of making adding a level easier as you only have to modify the random expression in the “random scene selection” scene instead of each and every scene.