Search Unity

Bug Addressables.LoadSceneAsync Breaks with Domain Reloading Disabled

Discussion in 'Addressables' started by FuriousEX, May 13, 2020.

  1. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    When I try to load a scene via the addressables system it loads correctly the first time, but when I run play mode again it will not load (stuck at 0 percent), until I force a domain reload by editing script or something.

    Maybe not relevant but when I try to activate the unloaded scene I get this error:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.ResourceManagement.ResourceProviders.SceneInstance.Activate () (at Library/PackageCache/com.unity.addressables@1.1.10/Runtime/ResourceManager/ResourceProviders/ISceneProvider.cs:27)

    Saw someone else was having the same problem a few months back here (he has provided code), but did not see a response or solve:
    https://forum.unity.com/threads/addressables-are-here.536304/page-9#post-5398932

    Edit: This only happens when the activateOnLoad parameter is false. I am using LoadSceneMode.Single. Manually activating the scene after load does not prevent this bug.
     
    Last edited: May 14, 2020
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,822
    Thanks for the report! I'll flag for the team.Which version of Addressables are you using?

    Additionally, if you haven't yet, please file a bug report for us as well: https://unity3d.com/unity/qa/bug-reporting
     
  3. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    I tried this on 1.1.10 and 1.83, same problem with both

    Edit: Found out that calling Addressables.InitializeAsync() before using the system prevents the issue from happening.
     
    Last edited: May 15, 2020
    Streamfall likes this.
  4. FuriousEX

    FuriousEX

    Joined:
    Mar 13, 2014
    Posts:
    51
    Looks like Addressables.InitializeAsync() doesn't band-aid issues with Domain Reloading off and Addressables.InstantiateAsync() - on non-reloaded re-launch I am getting missing reference exceptions when operating on the result of the complete callback of AsyncOperationHandle

    UnityEngine.MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
     
    Querke, Streamfall and Andresmonte like this.
  5. Querke

    Querke

    Joined:
    Feb 21, 2013
    Posts:
    54
    I have the same problem as OP. I am on Unity 2020.2.0f1, Addressables: 1.16.15
     
    Andresmonte likes this.