Application.LoadLevelAsync not working in Unity 3.3 Pro?

Hi everybody,

I've been looking for some answers for a moment now, and a lot of people seem to have this problem, but I never found any correct answer to that.

Basically I just use the code found on the Application.LoadLevelAsync doc page

`AsyncOperation async = Application.LoadLevelAsync("MyBigLevel"); yield return async; Debug.Log("Loading complete");`

It does load the level correctly, but it actually doesn't do anything different than the simple Application.LoadLevel; by this, I mean that I'm willing to have a user-friendly animation playing while my level is loading, and it doesn't. Even using the asynchronous loading, the scene just freezes until the new one is loaded.

In addition, I want to state that no, the scene being loaded is not heavy at all, so it can't come from a long initialization post level loading.

As stated earlier, a lot of people are complaining about that and there is never any answer given, so is it just a bug of Unity's last version or what?

Thanks.

Mine seems to work fine and I am on iphone, but I have all the gameObject's turned off in the next scene so as not to fire the Start() on all their scripts which have heavy work loads.... Here is how I do it, where LoadingScreen has a bunch of animated sprites

    // call back from a button
public void AcceptMission()
{   
    LoadingScreen.gameObject.SetActiveRecursively(true);
    SettingsPanel.gameObject.SetActiveRecursively(false);               
    MissionScreen.gameObject.SetActiveRecursively(false);               
    AcceptMissionScreen.gameObject.SetActiveRecursively(false); 
    StartCoroutine(LoadHangarAsync());
}   

    private AsyncOperation LoadingHangarOperation;
IEnumerator LoadHangarAsync()
{
    yield return new WaitForSeconds(1.5f);
        LoadingHangarOperation = Application.LoadLevelAsync("HangarRetina");
    while (!LoadingHangarOperation.isDone)
    { yield return 0; }
}

Well, i haven’t used Application.LoadLevelAsync yet, but the only thing that comes to my mind is that you forgot to mark your GameObject with DontDestroyOnLoad. When the loading is finished it will destroy all objects that are not marked with DontDestroyOnLoad and therefore your coroutine will just be erased. Don’t forget that coroutines run on a MonoBehaviour-script instance. If the script is destroyed the coroutine will be removed as well.

It’s been a few years since you asked, but just in case someone is still looking:

This page solved the problem. The issue is that AsyncOperation.progress can get rounded to 0 or 1 unless handled carefully. The person in the link simply multiplied the value by 100f.

Cheers.
-Ryan

I agree! I've tried to track the progress of the AsyncOperation and it goes from 0 straight to 1. I have a bigger scene that I am trying to load. There's no way an async load on it should go from 0 to 1. Anyone know what's going on here?

I am searching the answer anywhere, but get nothing now, waha

LoadLevelAsync do not create any type of loading animation in any Unity version, you have to create it yourself.