Progress always at 0

I used the “SceneManager.LoadSceneAsync” function and then asked the console to print the progress but it always return 0 even though the scene loaded. Idk if my code is wrong I watched several tutorials before:

IEnumerator ProgressBar(int SceneIndx)
    {
        AsyncOperation op = SceneManager.LoadSceneAsync(SceneIndx);

        while (!op.isDone)
        {
            float progress = Mathf.Clamp01(op.progress / .9f);
            Debug.Log(op.progress);

            yield return null;
        }

    }
IEnumerator ProgressBar(int SceneIndx)
    {
        AsyncOperation op = SceneManager.LoadSceneAsync(SceneIndx);
op.allowSceneActivation = false;

        while (!op.isDone)
        {
            float progress = Mathf.Clamp01(op.progress / .9f);
            Debug.Log(op.progress);

            if(progress >= 0.9f)
            {
               op.allowSceneActivation = true;
                 yield return new WaitForSeconds(1);
            }
            yield return null;
        }
    }

Try that, i feel like all you are missing is the allowSceneActivation. Without it, theres a good chance you see nothing happen at all, especially on fast loading content.

Nope, It still reporting 0 twice, I guess because the scene is loaded so fast it reports once the operation starts and once when it ends, but both of the reports are still 0

Hmm, possibly i forgot something, but you should have definitely noticed a 1 second pause.

I currently have a loader working on screen right now, with exactly the same implementation.

If you dont mind a screenshare, hit me up on discord. JD#1539.

Im sure its something silly. This same issue has popped a few times in jsut the past few days on these forums.

I think what you’re seeing is just that scene-loading works a bit differently in the Editor.

Build your project out, see if you see the same results.