Search Unity

Scenes within folders don't load with no error generated

Discussion in 'Addressables' started by fuj1n, Sep 16, 2018.

  1. fuj1n

    fuj1n

    Joined:
    Jun 14, 2013
    Posts:
    5
    I currently have a group named "Assets" which is marked as default, and I have dragged my "Arenas" directory into it, which has a subdirectory named SampleArena where a scene named SampleArena resides.

    AddressablesSetup.png

    Attempting to load the scene using Addressables.LoadScene("Arenas/SampleArena/SampleArena") seems to provide an IAsyncOperation that immediately has the status of Succeeded. I have tried just typing random strings into Addressables.LoadScene and it appears to behave the same, indicating that it is just eating errors as they happen.

    I have temporarily set it up by dragging the scene into the Assets group and naming it Arenas/SampleArena/SampleArena and it seems to work properly (the status is None until it is done, and the percentage gets updated, and finally the scene is loaded when done), but doing it this way is not desirable for what I am trying to accomplish.
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for letting us know, I've added this to our bug tracking and we'll investigate.

    -Bill
     
  3. ulfchristensen

    ulfchristensen

    Joined:
    Oct 26, 2017
    Posts:
    6
    *bump*

    This seems to be a somewhat general problem. At least I am experiencing the same symptoms with a slightly different use case.

    Scenario setup:
    A scene within the Built In Data folder contains scripts to load a different scene at run time.

    When trying to load the "external" scene the IAsyncOperation immediately has the status of Succeeded without any loading actually taking place.

    Example code:
     protected IEnumerator setupScene(string address)
    {
    var asyncLoadScene = Addressables.LoadScene(address, LoadSceneMode.Additive);
    asyncLoadScene.Completed += s =>
    {
    if (s.Status == AsyncOperationStatus.Succeeded && s.Result.isLoaded)
    {
    Debug.Log("Scene loaded");
    }
    else
    {
    Debug.LogError("Failed to download scene. Error: " + s.OperationException.Message);
    }
    };

    yield return asyncLoadScene;
    }


    This snippet generates the following error message in the console:
    Failed to download scene. Error: Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown.

    even when the address used is a vaild Asset Address

    *edit*
    Turns out the address was not actually valid, so the above code actually does the trick....
    Still annoying that the LoadScene operation swallows the error msg though.
     
    Last edited: Sep 26, 2018
  4. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Not sure if this is same issue, but I can't see to get baked lights loading with a scene using addressables regardless if I just specify just the scene or also add the baked lighting folder.