Search Unity

Bug Serialization Issue #47813 - Scene Prefab Disconnection

Discussion in 'Editor & General Support' started by Sisyphus-Studios, Dec 13, 2021.

  1. Sisyphus-Studios

    Sisyphus-Studios

    Joined:
    May 10, 2018
    Posts:
    22
    I am having a serialization issue with prefabs and will try to be brief, I am unsure if this is a bug or user error but I feel like I have a decent grasp on serialization at this point and it appears to be a prefab issue.

    I am on version 2021.2.2f1

    The Problem
    1. Starting up Unity after closing it (this never happens other than after a Unity restart) causes reference losses
    2. View several objects that all extend the same class (note that only some of them get the issue and only sometimes when restarting ~70% of them) and see that they are missing references
    3. In this picture you can see that the override is not overriding anything and nothing is in bold.
    upload_2021-12-13_12-41-33.png

    4. If we select the Prefab we get the same thing which makes sense you would think, but here is the issue
    upload_2021-12-13_12-42-41.png

    5. If you open the prefab to edit you can see that the reference to the Wire Panel is there (note that Specifications and Equipment are correctly missing references here). It's like there are 3 versions of the prefab, the prefab instance, the prefab asset, and the prefab asset editor data. The prefab asset editor data is correct but it is not propagating to the prefab asset/instance

    upload_2021-12-13_12-43-21.png

    There is some massive disconnect between the prefabs that I do not understand and the only way to fix it is to re-apply all references on the scene object and then click apply otherwise it doesn't think there have been any changes, because well, there haven't been apparently?

    Any guidance would be appreciated
     

    Attached Files:

  2. Sisyphus-Studios

    Sisyphus-Studios

    Joined:
    May 10, 2018
    Posts:
    22
    It seems like the issue is just the prefab asset doesn't save any changes made when editing the asset? Some of them do just fine and then some don't?

    When you select the prefab in the inspector it is missing all of the values and references
    When you go to modify the prefab it has all the values and references

    What would be causing this disconnect and why is there a difference between the asset object and the edited asset object?
     
  3. Sisyphus-Studios

    Sisyphus-Studios

    Joined:
    May 10, 2018
    Posts:
    22
    This was fixed by manually clearing the prefabs in edit mode, saving, and then setting their values and saving again. The prefab is having some sort of issue of syncing because it doesn't think any edits were made for some reason
     
  4. Nixaan

    Nixaan

    Joined:
    May 30, 2013
    Posts:
    118
    When a prefab is shown from the "outside" (i.e. scene or parent prefab) then the inspector fields are shown as if they are set to their default/reset values. But when you enter in the prefab (or nested prefab) only then the "real" serialized values are shown. Best thing is not to touch serialized values and prefabs until they fix this because as it is 2021.2.5 and 2021.2.6 (I haven't experienced this in earlier versions) may ruin your prefabs if you decide to do changes on them.
     
    Last edited: Dec 14, 2021