Application.LoadLevel : alternative SceneManager solution when using build index

So…didn’t want to lose this in a [SOLVED] post, especially one that seemed to drift off the original topic somewhat. If anyone else is using Unity 5.x and runs face-first into the issue of trying to get a build index without creating a slew of new scene variables to do so, I find the following is currently working for me:
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex + 1);

This replaces the Application.LoadLevel(Application.loadedLevel + 1); code in the lecture.

10 Likes

This solution works for me. Thank you for posting.

Thanks for posting this @Baiswith . Originally I used :

SceneManager.LoadScene (SceneManager.GetActiveScene ().buildIndex + 1);

After reading your post and check Unity docs again LoadSceneAsync actually has better performance than LoadScene and to avoid pausing and hiccups between loading the scenes.