Search Unity

Resolved [Solved] Reference lost in prefabs when updating from 2020.2.3f1 to -.4f1 and -.5f1

Discussion in 'Prefabs' started by gasppol, Feb 19, 2021.

  1. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    As the title say, when updating my project (currently on 2020.2.3f1) to newer versions (tested in 2020.2.4f1 and 2020.2.5f1) some, but not all, the references on the prefabs inspector properties are lost.
    Uploaded images show the "before" and "after" cases.
    Please note that the Override of each prefab shows, in most cases, no evidence of Revert option.
    Most of the cases are Prefabs Variants, but also, normal Prefabs. Couldn't find the pattern of occurrence.

    Note: I'm using Hierarchy2 asset.

    2020_2_3f1.jpg 2020_2_5f1.jpg
     
  2. meckzqz

    meckzqz

    Joined:
    Jul 2, 2017
    Posts:
    2
    Same issue here. We're not using the Hierarchy2 asset that was mentioned. Very frustrating.
     
  3. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    I had similar issue with references getting lost or becoming overridden when dropped into a scene. After restarting Unity and editing the prefab, the references got fixed but the weird overrides still have all the time. I think these 2 issues are related. Mine also happened on version 4, and I thought v5 fixed it.
     
  4. travis_unity746

    travis_unity746

    Joined:
    Nov 12, 2018
    Posts:
    14
    Same issue here; I'm not using Hierarchy2 either. I've rolled by project back to 2020.2.3f1. I'm seeing this issue on multiple computers using both 2020.2.4f1 and 2020.2.5f1

    Did anyone log a bug in the issue tracker? If not, I can log one...
     
    gasppol likes this.
  5. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    I can confirm it does not have any relationship with Hierarchy 2 asset, and it continues to fail in -6f1 version.
    I can confirm also that restarting the editor does nothing.

    Please make one!
     
  6. travis_unity746

    travis_unity746

    Joined:
    Nov 12, 2018
    Posts:
    14
    Hi, I've updated to 2020.2.6f1 and updated my project. The references were still broken. I closed Unity, deleted the Library folder for the project and re-opened Unity.

    This appears to have fixed the issue for me!
     
  7. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    I usually just open the prefab and remove and set the references again. Someone said that reimporting the prefab itself should fix it too, but haven't tried it yet.
     
  8. gasppol

    gasppol

    Joined:
    Feb 16, 2020
    Posts:
    33
    Thanks for the tip. It worked like a charm for me too.
    Also the Library now is more lightweight (I think).
     
  9. gazbushell

    gazbushell

    Joined:
    Feb 5, 2009
    Posts:
    53
    I am pretty sure this is not resolved.
    I find some prefabs still lose references and I am manually reimporting my prefabs folder at least once a day using 2020.3.2 through to 2020.3.5(current)
     
  10. Morphus74

    Morphus74

    Joined:
    Jun 12, 2018
    Posts:
    174
    Did you ever find a solution? I have some prefab that like to lose is reference in 2021.2.8
     
  11. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    246
    I use a script to reimport all of the prefabs in the project. Something like this:

    Code (CSharp):
    1. var objectGuids = AssetDatabase.FindAssets("t:Prefab");
    2. var objects = new Object[objectGuids.Length];
    3. for (var i = 0; i < objectGuids.Length; i++)
    4. {
    5.     var objectGuid = objectGuids[i];
    6.     var objectPath = AssetDatabase.GUIDToAssetPath(objectGuid);
    7.     var loadedObject = AssetDatabase.LoadAssetAtPath<Object>(objectPath);
    8.     objects[i] = loadedObject;
    9. }
    10. Selection.objects = objects;
    11. EditorApplication.ExecuteMenuItem("Assets/Reimport");