LoadLevelAsync more than once?

Hey guys!

I was wondering if I was able to load more than one scene asynchronously at once then call the respective scene based on in game events.

I currently have four scenes that I would like to asynchronously have loaded so at a moments notice I can have them seamlessly start. I seem to get strange issues having more than once async per scene… The strange one was if I had two async and I tried to call one of them, the other simply would not fire, nothing would happen when I triggered it. The other strange issue I am getting is, if I trigger the first asynchronous operation before the second one, (I know where they get called in code so I know which one is asyncing before the next) It will play audio from one scene but it will execute the scene that I wish to execute.

So I am not sure how to go about this, basically I have 4 scenes that I would like to have 100% ready to go and then in game depending on gameplay, respective scenes will play.

Thanks guys!

As far as I know this is not supported. If you can afford to have all four scenes loaded simultaneously you can just put all the content in one.

That’s not true. There’s many reasons for loading many levels async from cutting down on loading time, to memory management and this gets extended big time in 5.3 if roadmap holds.

1 Like

I would put all of the content in one, but each scene is very particular with special camera work and a lot of other stuff, it was much easier earlier on in this project to have the important stuff all in its own scene. I am talking about a split second delay without asyncing, but that is something I would like to remove all together, as I am a perfectionist like that I guess… it also is very frustrating to me and might also be to the players.

When asyncing just one scene, it works perfectly, there is no hang time at all when I fire the scene, it is perfect. I just have to figure out how I can get all four of these preloaded in a way.

Check for Unity - Scripting API: AsyncOperation

I did look through this and was unable to come to any conclusions.

I am currently trying to just load up 4 individual asynchronous operations and call them respectively but I have a feeling I am going to break Unity.

Okay I organized all of the scenes that I am trying to async into one class, then I hooked this into the rest of the game. Individually they fire perfectly. As soon as I have more than one Application.LoadLevelAsync in the same Start function, they all stop working. :frowning:

Does anybody have some kind of work around?

This is what my Start function looks like, if I comment out all but one async operation it runs perfect. I have also messed around with assigning different priority but still am having no luck. Any input would be greatly appreciated guys!

function Start ()
{

   win_async = Application.LoadLevelAsync("You_Win");
   win_async.priority = ThreadPriority.Low;
   win_async.allowSceneActivation = false;
   
   pow_async = Application.LoadLevelAsync("Pow");
   pow_async.priority = ThreadPriority.High;
   pow_async.allowSceneActivation = false;
   
   skull_async = Application.LoadLevelAsync("Skull");
   skull_async.priority = ThreadPriority.High;
   skull_async.allowSceneActivation = false;
   
   key_async = Application.LoadLevelAsync("Key");
   key_async.priority = ThreadPriority.High;
   key_async.allowSceneActivation = false;
   
}

I stand corrected.
I’d love to read more about this, but could not find anything related to asynchronous scene loading on the roadmap.

It’s the multi scene editing stuff on the road map. I am not at liberty to expand on this information as it’s up to Unity staff to announce and explain roadmap features. I can however reliably say that scene stuff is generally getting a good work over :slight_smile:

1 Like

Crud :frowning: So there is no chance this will be something that I can implement in the next few days? I am shipping my game by the end of this week or middle of next week to Steam :frowning: I am in the polishing and fine tuning stages currently :slight_smile: Really wish I could have all of these loaded up at once.

I spent a while today took these 4 scenes and smashing them into one scene, then toggling objects on and off and it kind of worked, but overall it felt kind of buggy to me, so I reverted to my original solution.