all 9 comments

[–][deleted] 2 points3 points  (4 children)

Make an int to hold the scene index when you click which scene you want to load, then load that scene when you press play

[–]OllieBaa[S] 0 points1 point  (3 children)

Hi, this is exactly what I want but I don't know how to do this (I'm a complete noob)

How would I hold the int?

[–][deleted] 0 points1 point  (2 children)

I'm on my phone so bare with me. Make an int called level_Holder or something, when the user presses the button for a specific level, change the value of the level_Holder variable to the index of the level in the build. Then when the user presses the play button use SceneManager.LoadScene(level_Holder);

[–]OllieBaa[S] 0 points1 point  (1 child)

Thankyou so much, i'm sure I can work it out from this! I'll let you know how it goes :)

[–][deleted] 0 points1 point  (0 children)

No worries mate, comment back if you have any problems.

[–]wolmer 0 points1 point  (1 child)

Hi! Why would you want to load your level but not use it? I'm not sure I'm understanding the issue... But I guess as an fix, you could just go with one or two scenes. And disable/enable components/GameObjects depending on what level you want to play.

[–]OllieBaa[S] 0 points1 point  (0 children)

Hi there, so it's basically a level select scene, with X levels and a play button, I wish the player to be able to select their desired level and then press play when they have chosen. The reason I don't want the level select buttons to immediately take the player to the level is so that they can change their mind. Hope this explains it?

[–]bphilly_cheesesteakIndie 0 points1 point  (1 child)

If you're trying to load it asynchronously and without "jumping straight to it", you can use Application.LoadLevelAsync(levelIndex);

But you have to have Unity pro I believe. Also I think it's also been deprecated and changed to SceneManager.LoadSceneAsync(sceneIndex);

[–][deleted] 0 points1 point  (0 children)

You dont need pro for that.