- Home /
IS it possible to load the whole game (and all scenes) at startup to avoid scene change delay?
I have a 3D game based on unity and I have made it in a way that all menu screens are different scenes, But loading takes time, and that makes it look like the game is lagging upon pressing a button. Is there any way to make the whole game and all scenes load at start-up and just show themselves when called? here's the code I tried: if (Application.GetStreamProgressForLevel(1) == 1 && Application.GetStreamProgressForLevel(2) ==1){ Application.LoadLevelAdditive(1); Application.LoadLevelAdditive(2); Application.LoadLevel(1);
I$$anonymous$$ NOT POSITIVE so take this with a grain of salt but I believe the first level never "caches" it goes straight into playing.
The theory behind this is it's assumed your first level is a splash screen or video or some kind of intro and you want to load right away.
So what you want to do is have the first level be a simple empty thing and then have the second level be something real and try to progress into that.
Answer by Hotshot10101 · Jan 06, 2014 at 02:53 PM
In your code you do the LoadLevel last. This will clear out all previously loaded levels. You want to either do what sparkzbarca said and have level 1 just be the default level or do the LoadLevel(1) first.
After that if you do the LoadLevelAdditive it will bring them in without removing level 1 already loaded.
If it were me I would just make level 1 the default level so that it loads automatically and then do a loadleveladditive on the other levels during the startup on some monobehavior script in level 1
Your answer
Follow this Question
Related Questions
Unity C# main menu script 0 Answers
Load another Scene after collecting 6 coins 1 Answer
Remembering the state of a scene 1 Answer
Streamed scenes in standalone build 0 Answers
Unity C# main menu script 0 Answers