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

unity LoadSceneAsync works like LoadScene

$
0
0
So I have this code : AsyncOperation async; public void Start () { StartCoroutine (LoadingScreen ()); } IEnumerator LoadingScreen () { yield return new WaitForSeconds (1); async = SceneManager.LoadSceneAsync (1); async.allowSceneActivation = false; while (!async.isDone) { if (async.progress == 0.9f) { async.allowSceneActivation = true; } yield return null; } } The game still freezes before it loads another scene. I want the game to still smoothly load while it is loading a different scene, how can I do that? Have I done anything wrong with my code?

Viewing all articles
Browse latest Browse all 194

Trending Articles