Quantcast
Channel: Questions in topic: "loadlevelasync"
Viewing all articles
Browse latest Browse all 194

Code not executed after LoadSceneAsync in a Coroutine

$
0
0
I'm relatively new to Coroutines and Level Loading, so please forgive my presumably rookie mistake.
I'm calling the following function using StartCoroutine: public IEnumerator LoadLevel(string levelPath) { AsyncOperation loadOp = SceneManager.LoadSceneAsync(levelPath); while (!loadOp.isDone) { print("loading..."); yield return null; } print("loaded level"); }
The level loads, "loading..." is printed once, but the second print never occurs. What have I missed here, or not understood? I thought execution would carry on after the while loop was exited?
Thanks for the assistance!

Viewing all articles
Browse latest Browse all 194

Latest Images

Trending Articles



Latest Images