I’m getting property modifications on properties that are not overriden or contain any visual hint in the editor.
Because of this, I’m having serious problems trying to see if a parameter is overriden. It’s confusing that if the you turn on and off a non-overriden boolean property and it becomes overriden even though the value is the same as the original (not this case).
The contents of the scene file are updated and contain overries on some parameters that are NOT overriden.
By this data, IsKinematic, Mass and Height are overriden, among the rest of default overrides (name, transform values…)
See the screenshot of how the editor for this prefab instance looks like:
The editor doesn’t show the overriden status, as you can see. In fact, before executing this code I reverted the IsKinematic status and saved the scene. The mass was never changed before, and the scene was just opened.
Seems like the two parameters that do not appear as “overriden”, Mass and isKinematic… have a FileID (component ID) that doesn’t exist in the target guid:
guid: 0dcd87b8a6954ec4b97832ec1a235234 → Points to the original prefab.
But the FileID 6388004975588362680 that corresponds with Mass and Kinematic doesn’t exist there. They are pointing to no component available.
For example, all default overrides to the transform component point to :
— !u!4 &7553294082261362735 ← File ID
Transform:…
But here is no component with the ID in IsKinematic and Mass…
Is this a bug? Dirty parts in my scene that are giving me problems?
Ok. I found the problem. Seems like a bug. It contains a pointer to a dirty component Rigidbody that doesn’t exist in the original Prefab:
I just overrided IsKinematic to true, and now I have two modifications: one for the GOOD prefab component, and the other one that stays false for a non-existing component.
Right, you have to be careful with old lingering data as it usually keeps sticking around. Not sure what happend in your case here. However a similar thing can be observed when you edit the code of a class and remove fields which were previously serialized. The serialized data is usually kept, even though there are no fields they belong to. When you later re-add those fields in code, they would still have their old seriailzed value. So yes, it’s possible to have dead / obsolete serialized data in your scene file and I don’t know a neat way to get rid of it (or to determine which is obsolete).
Thanks! I thought Unity got rid of old stuff… silly me.
Uh. well. A cleanup is possible by hand. At the end this is a custom Yaml file… if the guid referenced doesn’t have that component, that’s dirty, I guess. but not sure if that can be removed safely.
About “removing a field of a class” seems interesting…but Rigidbody never changed. That’s really weird.
I’ll have to find a way to know if it is referencing to an existing component. Thanks!