The question is answered, right answer was accepted
Loading screen
Hello, I am trying to make a loading screen between two scenes (Main menu & Game Scene) how can I do this? I have watched most tutorials but they always add ui and I do not want that. I just need a script which will transition between the scenes once you press "Play" on the main menu. I would also like to be able to add an image over the screen while it is loading! Thank you! :)
There is something i don't understand. How you expect to add an image without UI? Image is part of UI man.
If you want to load a scene then there is everything you need to write it yourself: https://docs.unity3d.com/ScriptReference/Scene$$anonymous$$anagement.Scene$$anonymous$$anager.html
If you have any problems, you can come back and ask.
I messed up in the writing. I do not want what most people add(the scroller loading bar) that is what I was referring too when I said “UI”. I have an understanding of scene management but I still do not know how to achieve a loading screen that will work without having a “fake loading screen”(one that says loading but you have to press another button to load the actual game scene).
I still don't exactly get what you want to achieve. If you want really fake loading screen just manipulate your UI in menu and change text or background image while still being in menu scene. Finally write a script that detects any input(or your button) and load next scene.
Answer by shakecaine · Nov 26, 2017 at 11:27 PM
There is no simple answer to this question but series of comments that helped the author. This comment was most helpful though i presume. So i quote:
You can do that with LoadSceneAsync and AsyncOperation by setting the flag(boolean value) allowActivation to false. It will load 90% of the scene in background and wait to change the flag. This way you can control scene loading. Without that Unity itself just loads scene when you invoke LoadScene function. Activating LoadScene from the button is the same as doing that from another function in your own script as you will also use LoadScene but have more control over what you want to do before switching to new scene. Although you still have little control when the scene is loaded besides that allowActivation flag. What happens is that when you invoke LoadScene Unity thinks you want to change the scene and does that if that is Async it does not freeze your game as that is background task but will still change scene once it loads. That is how i do it. Don't take exactly what is written there but you can be influenced by it.
This way i halt scene activation but you have to remember when you stop scene in editor when scene isn't fully loaded Unity will CRASH.