Loading screen after start game

Hi. I have game in my Android. After click on icons is about 2 seconds logo Unity, and after it 10 seconds black screen. Therefore I make loading screen. But efect no good. Now after Unity logo is 8 seconds black screen and 2 seconds loading screen. Turns out from 40% to 100%. Is there anything I can do about it? After Unity 10 seconds loading screen without black screen?

1 Like

Not sure what you are doing, but if you are using the Unity splash screen feature, you don’t actually have to do that if you don’t want to. You can have a scene be your “splash screen” and that works just as well in many cases.

Between the Unity logo and loading screen is 8 seconds black screen. I only do not want black screen. People may think that the game does not work. Look to

.

What are you loading? Looks to me like you might be doing something that maybe is taking some time before the loading bar comes up.

Every second spent loading is a few percentage of people who quit, so definitely load SOMETHING, a super-small simple “wheee!! I’m loading!” screen as your first scene, THEN go onto whatever your game does.

Exactly. But I do not know how. Therefore I learn and make Scene 0 = LoadingBar. And my game is scene 1. But still is first 8 seconds black screen and after it moment LoadingBar. Is there any settings in the buildgame something? Or is there any other procedure?

Like Scene 0 I have LoadingBar.

 private void Start()
    {
        StartCoroutine(LoadAsynchronously(1));
    }

    IEnumerator LoadAsynchronously(int sceneIndex)
    {
        AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex);

        LoadScreen.SetActive(true);

        while (operation.isDone == false)
        {
            float progress = Mathf.Clamp01(operation.progress / 0.9f);

            slider.value = progress;
            progressText.text = progress * 100 + "%";

            yield return null;
        }
    }
1 Like

Unity Logo appears immediately. How do they do it?

How long does a completely empty project built with that version of Unity and running on that Android OS take to load to the first screen? The difference between that number and your number is the portion you can address.

Also did you know you can name your scenes by string instead of using numbers? It’s much easier to reason about if you are loading a scene called “MainGame” instead of 2, for instance.

I will try it.

I only build the scene 0 = LoadingBar. After Unity logo is it displayed = 1 seconds.

It occurred to me that both scenes were loading at the same time.
Or it is probably loading assets.

I think that understand now. I don’t have a subscription. The Unity Splash Screen is uniform across all platforms. It displays promptly, displaying while the first Scene loads asynchronously in the background. This is different to your own introductory screens or animations which can take time to appear; this is due to Unity having to load the entire engine and first Scene before displaying them.

check your awake() and start() scripts in the first scene, dont load assets on the scene 0

your game only starts to run after the unity splash screen

Are you using a scene only for your splash, or are you using the splash screen settings? If you use the splash settings, I’m pretty sure that should display right away after the Unity splash…Or with it. I can’t recall which.

If you’re using a scene, then just have it be a logo. You can still load the next scene, but you want to make sure your logo is up and displayed while the call to load the next scene is going on.

Also, there should be an option under Android settings to display a spinning loading icon in the corner, you could just turn that on. I can’t recall the exact behavior, but that might be enough.

Also dont start loading your scene in start() of scene 0, give it 1 second where nothing happens so your loading screen has time to display( you can even fake the animation so it looks like its loading )

Yes. Now I understand. I dont speak english and this is my first big project. Therefore I didn’t know what it was Splash. Thanks. They didn’t say anything about it in the tutorials on you tube. I will be find it and learn, how use it.

Tutorials generally focus on getting the basics working. Things like optimizing loading screens probably don’t end up in tutorials.

Also, when you’re experienced enough to create tutorials you probably are using a Plus or Pro license, and the first thing a Plus or Pro license holder does when they create a new project is disable the Unity splash screen :stuck_out_tongue: So you won’t see much mentioned about it most likely.

Thanks, for your help. I did many attempts all night.
If start loading scene was in Awake, it does not function.
If start loading scene was in Start. It does not function.
But when I gave a 1 second delay with Invoke. It is function. But 1 second is empty screen. Therefore I shortened Invoke. Now I have Invoke(“LoadingScene1”, 0.01f), and it is still function.
I tryed again it without Invoke, and It does not function.
Invoke must be.
Now I can change graphic design loading bar.
Look how it function with Invoke 0.01f. 8 seconds black screen is gone.

https://www.youtube.com/watch?v=AZNh8R8TB7E

2 Likes

You might just want to start it from the first frame instead of using Invoke. Awake is called while all the objects in the scene are initializing, and Start is called before the first frame. You can call something from the first frame pretty simply using Update

private bool alreadyCalled = false;

void Update()
{
    if (alreadyCalled == false)
    {
        MethodToCallOnTheFirstFrame();  //Replace with the name of the method, or whatever work, you want run on the first frame
        alreadyCalled = true;
    }
}
1 Like

I had same issue with having 10 sec or so black screen after unity splash screen, and this helped me. To clarify, the solution is simply to wait a short moment before loading your main scene. So just add a little delay in your scene 0 loading scene script that loads the main scene. I did it like this:

public class LoadingScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(LoadYourAsyncScene());
    }

   IEnumerator LoadYourAsyncScene()
    {
        yield return new WaitForSeconds(0.02f);

        AsyncOperation asyncLoad = SceneManager.LoadSceneAsync("Main");

        // Wait until the asynchronous scene fully loads
        while (!asyncLoad.isDone)
        {
            yield return null;
        }
    }
}
7 Likes