Search Unity

Prefabs marked addressable & added to new group dont include the materials & meshes (always missing)

Discussion in 'Addressables' started by XRA, Feb 29, 2020.

  1. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    2019.3.3f1 & Addressables 1.6.2

    Having really strange problem, if I add a prefab to a new addressable group (by the Create Group > Packed Assets)
    the prefab when loaded will not have any mesh or material assigned (likely missing textures too).

    The group has the exact same settings as Default Local Group

    When the prefab is moved to the Default Local Group, it loads in with the mesh and materials assigned.

    I used to not have this issue when on 1.1.10 but then upgraded, and now all my addressable setup is broken & I'm having to attempt to recreate it all again.

    Is the expectation that every texture, material, shader etc (every possible asset in use) must be placed in groups?
     
    Last edited: Feb 29, 2020
    arufolo-wellovate likes this.
  2. XRA

    XRA

    Joined:
    Aug 26, 2010
    Posts:
    265
    OK I figured it out... I was still using an IASyncOperationExtension from way back & didn't realize it was in use, it was calling Adressables.Release(handle) thus the loaded addressables were releasing their dependencies, but the instantiated game objects were stick around (thus the missing meshes and materials)

    I guess at some point the Release behaviour may have changed with how references are managed, I'm not sure why it seemed to be working before.
     
    Last edited: Feb 29, 2020
    arufolo-wellovate and adamgolden like this.
  3. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    Thanks for posting what the problem was, I just went through something similar and this got me to the root of it. It turns out I was calling .Release on an addressable prefab while still using an instance of it (i.e. created through Instantiate). I guess instances rely on the prefab they were instantiated from for references - which I didn't realize.
     
    arufolo-wellovate likes this.