- Home /
Question regarding Async loading waiting for a loop to complete.
I just want to start by saying I have googled this and found a thread with a similar discussion however it's not exactly what I need so sorry if anything feels this is a dupe or sorts.
I have Level 0 - Loading screen and Level 1 - Main Game.
When using LoadSceneAsync to load my Level 1, as far as I'm aware it's just loading the entire scene, waiting for it to be complete and then switching to that scene.
I have a Function on a script in the Level1 that runs a loop that takes around 3 seconds, this loop obviously starts when the scene is fully loaded. Is there any way I can mark that function so that it has to complete before the scene is loaded? Kind of so it's part of the Async loading? [EDIT] At the moment I'm getting the desired effects by essentially duplicating my loading screen onto my main scene and then on start, waiting 4 seconds and then SetActive(false) the loading screen canvas. So that's working as a hacky way around it, just wondering if there's a proper way of doing things.
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612202518im_/https://answers.unity.com/themes/thub/images/avi.jpg)