[Urgent] Textures go missing when reloading a Scene via Addressables

Hello everyone,
We are experiencing yet another problem with addressables in our project.
It happens when we try to load an in-game scene directly on Unity editor and it all loads and works fine in the beggining. The problem then occurrs when we reload the scene (via a ‘Restart Level’ option from our ‘Pause Menu’) and some of the textures goes missing (which is odd beacause the asset textures seems to be correctly loaded on the Event Viewer).
Some important notes abou our implementation:

  • All assets in our project are marked as addressables;

  • Asset groups are divided by asset type (prefabs, textures…) and then broken into smaller groups;

  • All asset groups are configured to use Bundle Mode ‘Packed Together’;

  • All scenes are loaded via Addressables.LoadSceneAsync in single mode;

  • Before loading the next scene, we unload all loaded assets from the current scene via Addressables.Release (we manage this with an internal script that keeps track of all loaded assets);

When we had previous issues with addressables, in some ocasions we were able to solve them by rearranging the assets groups. So we were wondering if we are packing the asset groups in a way that causes it to malfunction, or if is there any specific grouping layout guideline to be followed?
And if this is an asset grouping layout issue, its not clear to us why it does not happen on the first load of the scene.

I’m sorry if this seems like a basic question, but we are having a hard time just trying to understand and fix the issues we encounter day after day when adapting our project to use Addressables.
Docummentation seems very scarce regarding best practices and even a fully Addressables sample project (which would be very helpfull to guide us) seems to not exist.

Did anybody go through a similar issue and could help us with this?

I’ll flag this for the team to have a look. Which version of Addressables are you using again?

Hi @TreyK-47 , thanks for your support. We’re using 1.12.0. Our issue seems to be related to this post here, where I also elaborated better what is happening to us…

Muse me one second, could you verify that the bundles you were using were unloaded before you reloaded the scene? Because I’m just implementing a fix for an asset loading issue that took me 70 hours of investigation…

Hey @AlkisFortuneFish , we even tried loading an empty scene before loading the next, and suspending the use of any “Don’t Destroy On Load”/static. In the Event Viewer, we could see the bundles unloading, and then loading again. And even so, the references were getting lost in the process…
I hope this information helps you, and good luck with the fix!

Hm, ok, different issue then, thanks! What we have is that our code was leaking references for various reasons, which would result in some of the dependencies not being unloaded. For some bizarre reason, when this happens, when dependent objects are reloaded later, dependency resolution fails, ending up with textures, materials, ScriptableObjects and all sorts becoming null or, more bizarrely still, dropping type to UnityEngine.Object.

@andre_unity573 this sounds very much like an issue that was fixed in 1.13.1. There was an issue where dependencies were staying in memory for one reason or another and when bundles, like your scene bundle, were reloaded they wouldn’t sync back up correctly to their dependencies. Not 100% sure if it’s the same thing but it might be worth checking out. Let us know if that doesn’t work.

Also, as far as samples go, I don’t know if you’ve seen GitHub - Unity-Technologies/Addressables-Sample: Demo project using Addressables package which is a project with several samples in it. As a note, these are likely on older versions of Addressables and need to be updated.

1 Like

That is very interesting, as that behaviour is a pretty close match to the behaviour I’ve found but my repro still repros on 1.13.1. I’ll see if I can submit a bug report, it’s tricky because of the size of the project, it’d be much better if I can chop it down to just the relevant data and code.

@davidla_unity apparently this solved most of our issues :)) We are still confirming if everything is indeed correct, but it appears that everything is loading/unloading correctly now! Thank god, we were one month trying to solve these issues with other approaches. If anything appears wrong in the tests will let you guys now hehe
Btw, I don’t think a post is worth it, but you should consider a “search/filter” feature in event viewer for making it easier to track certain assets when necessary. But well, minor feature, would be good but we can live without it, not sure if you want to add it to your backlog :slight_smile: