[Bug] [1.1.4] GameObject loses material on scene reload in Build

I think this is a bug unless I’m doing something very silly. Present in the latest previous versions as well. Using Unity 2019.1.7f1

  1. Open Scene which loads a GameObject using InstantiateAsync. Everything loads fine.
  2. Change scenes.
  3. Return to previous scene
  4. GameObject loads using InstantiateAsync again. This time the GameObject is pink

I’ve also tried calling Addressables.ReleaseInstance and Addressables.Release when the scene unloads just in case it would matter. My understanding is this is unnecessary since the scene unloading cleans the GameObjects up in the Addressables reference count. Nothing changed when I did this.

This only happened in a build release and debug. I’ve never seen it happen in the editor.

4669769--439310--Screenshot 2019-06-20 at 21.12.52.png
4669769--439313--Screenshot 2019-06-20 at 21.11.43.png

1 Like

@unity_bill is this a bug?

I should mention this happens to all GameObject’s with a SpriteRenderer Materal, not just the GameObjects loaded by Addressables. If I don’t use Addressables to create GameObjects with SpriteRenderers then it doesn’t happen anymore.

Almost certainly a bug. We’ve heard of similar issues, but haven’t been able to track them down. This should send us in a good direction. If we need more info, I’ll let you know.

Thanks @unity_bill !!!

@unity_bill I don’t really understand why but I reorganised the code this morning and it’s no longer happening.