Loading Two Scenes Async

Hi,

I’m hoping to touch a portal, unload the first scene, load two scenes at the same time asynchronously (cutscene and next location scene), display the cutscene scene while the next location is still loading, and then unload the cutscene scene to display the next location scene.

How would I go about loading both new scenes at once, even in the initial scene handling the loading of both scenes gets unloaded?

My initial thought was to have some ScriptableObject for the name of next location Scene, load the cutscene, and then start loading the next location during the cutscene, but I want a more optimal solution where the next location scene has as much time to load as possible (as in, before the cutscene is shown and the first scene is unloaded). All I could think of was loading both async, but I feel unloading the initial location scene would wreck that optimised idea, and don’t know how to code it.

Kind Regards,
Sean

What was wrong with your original thread mate?

I could be wrong but I feel like I’ve read something about it being a bad idea to load two scenes at once, particularly if you want to delay the activation of one with AsyncOperation.allowSceneActivation = false. Something about it causing Unity to end up in a dead-lock.

Even then, and putting that aside, it would make more sense to load and get the cutscene underway, and then start loading the next scene. Ultimately you’re a bit tied down by Unity’s restrictions here.

2 Likes

Thank you so much!

The original post felt like I didn’t get an answer, and with how active the forums seem to be, it seemed too deep to continue getting any more replies, even if now just on page three at the time of this reply.
The first reply to the original post felt like they wanted more info, which I provided but wasn’t hearing anything back, and the second reply seemed to complicate the situation more and, unless I misread it, didn’t solve what I trying to achieve.

Thankfully, your reply seems the best. Even though it’s basically telling me not to go ahead with my idea, at least I know why, and I truly appreciate it as I haven’t just had it solved for me - I’ve learnt.

To be frank, you can un/load two scenes async at once if you’re absolutely sure that you will activate the scenes. The finish of the second un/load won’t happen unless activate the first one. It is that simple.

If you can’t guarantee the activation of the first load, then you should not un/load simultaneously.

But this is exactly what is documented here:

2 Likes

Whatever the reason, this is a duplicate thread. Please don’t do this.

I’ve closed the previous duplicate.

Thanks.

1 Like