- Home /
How to hide the black screen while loading scene / load level in the background
When I start my app, I get a temporary 8 seconds black screen right after the splash screen, and after that my heavy scene is loaded. To solve this and after reading other questions- I added an empty Scene0 in order to load the heavy scene in the background. But it didn't solve the problem- I tried 2 solutions:
1-
public class Scene0 : MonoBehaviour
{
public string levelName;
AsyncOperation async;
void Start() {
StartCoroutine("load");
}
IEnumerator load() {
async = SceneManager.LoadSceneAsync(heavyScene);
async.allowSceneActivation = false;
yield return async;
}
public void ActivateScene() { //Button
async.allowSceneActivation = true;
}
Result: 4 seconds black screen after the splash screen + 4 seconds black after clicking the button (scene was supposed to be loaded so not sure why black)
2-Removed void Start() function. And changed the button function to-
public void ActivateScene() {
StartCoroutine("load");
async.allowSceneActivation = true;
}
Result: No black screen after the splash screen (yay). But 8 seconds black screen after clicking the button
Your answer
Follow this Question
Related Questions
Unity splash image for Android build is black 1 Answer
How to create a loading screen at the beginning? Load asynchronous not working 0 Answers
Do we need pro version for loading progress in unity 5 ? 0 Answers
Load music only when everything is loaded 1 Answer
Android app freezing on splash screen 0 Answers