Good way of changing scenes? Tell me if you like it

static int activeScene=0

void Start()
    {
//.....and down bellow

 void LoadNextScene()
    {
        SceneManager.LoadScene(++activeScene);
    }
 void LoadCurrentScene()
    {
        SceneManager.LoadScene(activeScene);
    }

So i set myself a challenge to do the scene swapping before watching the video and this is what i came up with, i think its simpler.
I figured out that variable must be static for this to work, if its not, then the variable will keep resetting to 0 after loading next scene.

1 Like

Privacy & Terms