You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that any Dict with GameObject as a key cannot serialize arrays as its values. I discovered this first with my own data type, but found that the same held true for <GameObject, string[]> for instance. Using GOs as keys to non-array values works as expected. This behaviour was observed on a Scriptable Object.
When setting these from script:
The values are assigned correctly, but get cleared as soon as Play Mode is entered or anything gets recompiled.
When assigning from the Inspector:
As soon as I try to set the GO key field the entire entry disappears.
The text was updated successfully, but these errors were encountered:
you should be using the gameObjects unique identifier rather than the object itself
the issue however is that game objects do not typically instantiate with the same properties, you should probably use some sort of global class or GUID system
Hi,
I noticed that any Dict with
GameObject
as a key cannot serialize arrays as its values. I discovered this first with my own data type, but found that the same held true for<GameObject, string[]>
for instance. Using GOs as keys to non-array values works as expected. This behaviour was observed on aScriptable Object
.When setting these from script:
The values are assigned correctly, but get cleared as soon as Play Mode is entered or anything gets recompiled.
When assigning from the Inspector:
As soon as I try to set the GO key field the entire entry disappears.
The text was updated successfully, but these errors were encountered: