Search Unity

AssetReference's RuntimeKeyIsValid() does not work properly if a subobject is referenced.

Discussion in 'Addressables' started by KarimTA, Sep 25, 2019.

  1. KarimTA

    KarimTA

    Joined:
    Jan 8, 2019
    Posts:
    27
    In my case a sprite is referenced by an AssetReferenceSprite. RuntimeKeyIsValid() returns false, but loading the asset reference actually works as intended.

    RuntimeKeyIsValid tries to do a GUID.TryParse of the AssetReference's RuntimeKey. Or, when a sub-object is referenced, the RuntimeKey value is {GUID}[SubObjectName] seemingly causing a failure of GUID.TryParse.

    As a workaround, I manually check the GUID.TryParse for the AssetGUID.

    I opened an Issue Tracker ticket (1186801).
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    Thanks for the issue and for letting us know. definitely a bug we need to take care of.
     
    KarimTA likes this.
  3. KevinGelking_Sviper

    KevinGelking_Sviper

    Joined:
    Sep 17, 2019
    Posts:
    1
    I've just stumbled upon the same issue and can confirm this behavior. The workaround the thread owner mentioned does work, but it would still be nice for the Unity check to work as intended in one of the upcoming releases. :)
     
  4. TacticalShader

    TacticalShader

    Joined:
    Dec 5, 2018
    Posts:
    27
    This bug is still present in 1.5.1
     
  5. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    We have a fix in currently and it should be released in 1.6.0
     
    TacticalShader likes this.
  6. davidrochin

    davidrochin

    Joined:
    Dec 17, 2015
    Posts:
    72
    Still happening to me and I'm on 1.6.0... Did you release the fix?
     
  7. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    763
    @jdrc8 It should be out by now. Try updating to the newest version of the package and see if it's still occurring. Maybe it didn't make the cut on 1.6.0. Let me know if you're still having trouble.
     
    davidrochin likes this.
  8. CameronND

    CameronND

    Joined:
    Oct 2, 2018
    Posts:
    88
    I had the same issue in 1.6.0.
    Confirming its fixed in 1.6.2!
     
    davidla_unity likes this.