Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Addressables UnloadSceneAsync only half working?

Discussion in 'Addressables' started by diesoftgames, May 12, 2020.

  1. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    69
    I'm in 2020.1b07 and I've tried Addressables 1.6.2 and 1.8.3 with the same behaviour, but when I UnloadSceneAsync, the completed handler of the return operation is never called, which kind of makes sense since the scene is also never unloaded, though it does get grayed out in the scene hierarchy view. On top of that, the result of the operation says percentComplete is 1, but isDone is false. @____@ I'd love some help with what's going on here, I assume this isn't just a non-functioning API and I'm doing something wrong, but it's a fairly straight-forward use case where I'm just calling it with a SceneInstance previously given to me by the Addressables.LoadSceneAsync method.
     
  2. diesoftgames

    diesoftgames

    Joined:
    Nov 27, 2018
    Posts:
    69
    Okay, I'm onto something here: Addressables does not seem to like that I've preloaded some scenes (in this context meaning I called Addressables.LoadSceneAsync with activateOnLoad = false and I'm holding onto those SceneInstances to Activate them as appropriate). They sit in the scene hierarchy greyed out with an indication that they're still loading, but if I do that, it completely breaks other attempts, not just to unload, but also to load.

    So I suppose Addressables doesn't like having to deal with more than one scene at a time and that seems to be the heart of this bug? I'll try going back to what I was doing before with manual scene activation be enabling/disabling a root game object and make sure Addressables scene loading/unloading works with that use case.

    EDIT: Can confirm the Addressables scene loading/unloading works fine if I handle the activation/deactivation of scenes myself by putting the contents of the scene into a root GameObject that I just set active/inactive as needed.
     
    Last edited: May 12, 2020
  3. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    460
    Others have noted that it's a limitation of the Unity engine, and not Addressables. If you try to do the same thing through the regular SceneManager, you should see similar behavior.
     
    diesoftgames likes this.
unityunity