Hi, We were using addressables for our current project but we don't know if we are missing something. When we use a behaviour at animator, returns null: _animator.GetBehaviour<BehaviourCallbacks>(); //returns null If the object isn't addressable, works perfectly but, when we use that object as addressable, fails. Is it a bug or are we doing something wrong? Regards.
Hi, I have found another related error with addressable system. I have tried to load an Audio Mixer from addressables. I have tried it with AssetReference and directly with the path.It doesn´t work well, the system return me always a null object( only in release version in all platforms, in editor works fine).I write the code here: Code (CSharp): IEnumerator LoadMixer() { AsyncOperationHandle<UnityEngine.AddressableAssets.ResourceLocators.IResourceLocator> asyncO = Addressables.InitializeAsync(); yield return asyncO; AsyncOperationHandle<UnityEngine.Audio.AudioMixer> asyncOp = Addressables.LoadAssetAsync<UnityEngine.Audio.AudioMixer>(audioMixerPath); yield return asyncOp; UpdateMixer(asyncOp.Result as UnityEngine.Audio.AudioMixer); }
someone else had this issue, but the forum thread dried up before I could get info: https://forum.unity.com/threads/statemachinebehaviour-returning-null-in-1-1-7.722816/ So if you have a repro, definitely file a bug against unity and put the case number here. I don't believe this is related. Is this broken as of the latest (1.2.4)? We used to have an issue where AudioMixers were getting stripped from the build due to them appearing to be an editor type. This is fixed in the latest, so please make sure you are on latest and let me know.
Hello Bill, we are in the lastest addresables version (1.2.4).So, this error persist yet. Also we have noticed that _animator.GetBehaviour<BehaviourCallbacks>() return a good value if we wait some time(PedragDanilovic Problem).It is like a time dependence problem.The game object is active when we call to this method but if the object is recently created then the behaviour isn´t avaible. Cheers.
Hey @jpiera as it so happens we just fixed an issue with AudioMixers getting loaded from Addressables. With what's given it's hard for me to confidently say if our fix will resolve your AudioMixer problem or not. In regards to your animator problem if you wouldn't mind filing a bug report and providing a project we can use to reproduce it that would be a massive help. Thank you!
Hello Bill. Currently I have the same issue as @jpiera . I think that this issue wasn't completely fixed. I have tested with 2 case: case 1: Code (CSharp): [SerializeField] private AssetReference _audioMixerRef; public void TestLoadAudioMixer() { _audioMixerRef.LoadAssetAsync<AudioMixer>().Completed += handle => { /// Some Stuff }; } And on editor, the audioMixerRef was set like this: => Then everything work well case 2: With the same code above. And on editor, the audioMixerRef was set like this: => This errors come: Exception encountered in operation UnityEngine.AddressableAssets.Initialization.InitializationOperation, result='', status='Succeeded' - Chain<AudioMixer>: ChainOperation of Type: UnityEngine.Audio.AudioMixer failed because dependent operation failed Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=394d22817bfd1436eabdd3c998c72a6f[Master] UnityEngine.ResourceManagement.ChainOperationTypelessDepedency`1:OnWrappedCompleted(AsyncOperationHandle`1) DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.ResourceManagement.ResourceManager:Update(Single) MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19) and This: Exception encountered in operation UnityEngine.ResourceManagement.ResourceManager+CompletedOperation`1[UnityEngine.Audio.AudioMixer], result='', status='Failed': Exception of type 'UnityEngine.AddressableAssets.InvalidKeyException' was thrown., Key=394d22817bfd1436eabdd3c998c72a6f[Master] UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationBase`1:<.ctor>b__27_0(AsyncOperationHandle) DelegateList`1:Invoke(AsyncOperationHandle) (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.AddressableAssets.Initialization.<>c__DisplayClass13_0:<LoadContentCatalogInternal>b__0(AsyncOperationHandle`1) DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.ResourceManagement.ChainOperation`2:OnWrappedCompleted(AsyncOperationHandle`1) DelegateList`1:Invoke(AsyncOperationHandle`1) (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/DelegateList.cs:69) UnityEngine.ResourceManagement.ResourceManager:Update(Single) MonoBehaviourCallbackHooks:Update() (at Library/PackageCache/com.unity.addressables@1.5.0/Runtime/ResourceManager/Util/MonoBehaviourCallbackHooks.cs:19) The same thing happen with the Addressables.LoadAssetAsync() API. Code (CSharp): Addressables.LoadAssetAsync<AudioMixer>("MyAssetAddress[MixerGroup]") => error Code (CSharp): Addressables.LoadAssetAsync<AudioMixer>("MyAssetAddress") => worked Hope this can have you fix this bug. Atm, We don't know the load subObject of AudioMixer ("MyAssetAddress[MixerGroup]") is by design of addressable (just like SpriteAtlasRef) or it just a editorDrawer bug so if you can please let us know. Thanks.
Ah, I see what you mean. I think this might be more an issue with loading an objects sub-assets rather than being specifically about AudioMixerGroups (though I could be wrong). I'll get a ticket made for us to look at this.