I updated from Addressables version 1.17.17 to 1.18.2 and it creates a handful of super weird bugs and breaks my game. Downgrading back to 1.17.17 fixes it and it runs like it should again.
I can’t really pin-point what exactly is happening, but I’ve narrowed part of the problem down to Addressable.LoadAssetsAsync(“Mandatory”, null). Which loads all of my mandatory assets in at start up. It’s as if calling this, is instantiating some of the various objects that it loads. The bug happens every single time when running version 1.18.2, so it’s easy to reproduce. Not sure if anyone else is having these breaking issues with this version, but I figured I’d post it as I’d like to continue using the newest versions of the Addressables.
It happens every single time. Unfortunately I really do not have time to track down a minimal repro given that there’s no actual readable errors… Everything works under 1.17.17. I’m happy to provide my entire project, but it is 13GB.
Edit: I couldn’t leave well enough alone and created and submitted a repro.
The problem is just as OP says. Addressables is running scripts on assets when you call LoadAssetAsync.
“Fixed issue where loading of Prefabs and ScriptableObjects in “Use Asset Database” and “Simulate Groups” play mode could cause changes to source Assets. Now those play modes will return instanced copies of the Assets.”
I will have a look into this, that change does make instances of Prefabs before providing them in ADB mode. For now, using 1.17 or “Use Existing build” will work as you need.
Hi @andymilsom . I also would like to inform u that 1.18.2 breaks my dots project. From my observation, even u use Addressables.InstantiateAsync there’s prefab created internally before Instantiate actual game object. Now the behavior of prefab has been changed to behave like game object meaning Convert and Inject Game Object become creating 2 entities instead of 1 entity and turns out breaks my project.
When I update To 1.18.2
In Use AssetDataBase Module My Prefab Contains EventSytem is failure,All UIs cannot be clicked,
In Use Existing Build it work
Good Job With Adressables
Second this, Addressable.InstantiateAsync() an asset will load a prefab, as well as create an instance. However, the loaded one will also call Awake() and Start().
That should not be the case! I check 1.15, it’s not the same!
The bad thing is, I have already published my remote asset in a live project using 1.18.2. I didn’t notice this problem as I only used addressable to load audio assets.
Now I start to use addressable to load game object prefabs, this wrong behavior needs to be fixed.
I hope reverting back to previous version won’t break my live release…
To reproduce this problem with 1.18.2 is easy, in official demo, e.g. Basic Reference scene, update the addressable package to 1.18.2, attach a new script on cube prefab, do a debug print in awake and start.
You will see output like this:
======= Cube(Clone) Awake =========
======= Cube(Clone) Awake =========
Assertion failed on expression: ‘ShouldRunBehaviour()’
Assertion failed on expression: ‘ShouldRunBehaviour()’
======= Cube Start =========
======= Cube(Clone) Start =========
This will be fixed in the next upcoming release, I currently have it fixed to address both the original bug and the new one. And will be investigating more before the update to see if there are any edge cases that I haven’t concidered.
After looking into all the options available, it was decided that the original change should be reverted. The changes were intended to make AssetDatabase mode work the same as Existing Build/Release. Though we can address the issue for Prefabs calling methods, we cannot do it for ScriptableObjects at this time. Other issues such as if you have a ScriptableObject that references a Prefab, that Prefab would be the Project Asset. At this time the solution is causing more problems than the original issue (making changes to loaded Assets in Asset Database mode, modifies to actual project asset.).
The next release 1.18.5 expected within a few days will fix all the issues in this thread.
Sorry for the delay, we had delays causing the release to keep getting pushed back.
Addressables 1.18.9 has now been released, and has the fix to this issue.