#ArgumentException: We are reading a UnityEngine.Object but the deserialized index is out of range...
1 messages · Page 1 of 1 (latest)
Anything noteworthy in the scene itself?
That's what I'm trying to determine right now. I don't think there's anything special.
The scene has a EntityPrefabReference to 2 big prefabs which are the managers for Client and Server worlds.
Those prefabs may have a few Managed Components, like this. Actually that might be the only one, but I'm not completely sure.
Just to run down the list, you've tried clearing the entity cache?
Yes
I tried removing that component from baking, but the issue persist. I'll try to see if there's another managed component.
I'm getting this warning right before the errors shown above. I checked the prefabs I mentioned, and there's no sight of any missing component or reference. What else could cause this warning?
I don't know. Any chance you can write up a bug or put a project up somewhere?
I can write the bug report, but for the repro project I'd need to pin down the issue. My project is too big to share.
Gotcha
I saw this warning when load some addressable with script that absent in current project
Yeah, I remeber seeing it in that case too. But the weird thing is that the prefabs that's being loaded with the scene has all its components correctly referenced. So either there's another reason for that message, or maybe it's completely unrelated to the issue
Can you try convert your unity object references to UnityObjectRef<>
(pools parent is what I'm looking at)
Most failures I've seen like this were from Object references that also end up in seperate asset bundles such as Resources (or addressables) and that just seems to break.
That said, UnsafeHashSet?
Are you trying to serialize that during baking?
You can't bake allocated containers
Okok. Right now I'm removing all components to pindown the one causing the problem. I'm left with a few ones
That component was a result of things not working like they were supposed to in previous versions. The collection was actually empty at baking time, I just needed the component present in that prefab. But I just removed it, I add it at runtime now.
I haven't found out the real issue yet, but I found this.
After removing a buch of stuff (Components and references to prefabs), I'm left with a prefab that I use to spawn some particles using VFX Graph. The thing is, as soon as I remove all VFX Graph components in the prefab and children, the issue is gone.
Also, if I just delete the reference to this prefab, the issue is gone too.
Do you get this in the editor when loading a scene, or just a player build?
Editor.
Also, the workflow in my project is like
Scene-> Loads Subscene-> Loads Server & Client Manager Prefabs -> Those have a reference to all the rest of the prefabs (including the particle mentioned above).
Ah okay
Does the UnityObjectRef<T> inspector is supposed to work now? I'm trying to drag and drop the object and clicking the circle thing on the right but none of those work. _CoreMixer is the UnityObjectRef<AudioMixer> version of CoreMixer.
This complicates things a little more
can't use UnityObjectRef as a field on your authoring
it will break during baking as it only serializes instanceid
which will be different in your baker thread
it has an implicit conversion to T
Oh ok ok. My bad
actually i think this is unitys bad by marking it serializable and giving it a custom inspector
that makes it appear like it works
Hahaha my bad for not guessing correctly this Unity puzzle
So, in one of the cases causing the issue, replacing a managed component that has a direct reference to a Unity.AudioMixer, with an unmanaged component that uses UnityObjectRef<AudioMixer>, changes the error message to these two shown here.
Not adding the component at all, removes the issue.
where does the AudioMixer exist?
is it a prefab? in the subscene? in the regular scene?
It's an asset in a generic folder. And it's not being used by Addressables, the only place it's being referenced is the Authoring Component used to bake the components mentioned above.
hmm that avoids basically every issue i know of
Oh haha, that's not good. And from what I've seen, the issue can be anywhere where managed components or Unity.Objects are used.
@obtuse mulch I replicated the SoundsManager authoring workflow in a new project, and I haven't been able to reproduce the issue. So even though, the managed object is triggering the errors, it's not the main reason. Something else is messing with the project, and now I have no idea where to look at. What should I do? If I create a bug report with this info they'll probably just ignore it.
Ignore? No. But without repro info yeah it’s tough to solve. I’ll take a look next week and see if there’s any traces that might be helpful