Search Unity

Prefab Variants Lose Overrides Randomly

Discussion in 'Prefabs' started by TheTall2338, Sep 9, 2019.

  1. TheTall2338

    TheTall2338

    Joined:
    Jul 5, 2015
    Posts:
    2
    We have prefab variants that have components/gameobjects added as overrides to the base. Pretty straightforward. Sometimes after working on simple things (like position of a RectTransform) in the variants or the base prefabs, I run the game to get null reference issues. I open the prefab I just touched and a random assortment of components/gameobjects/script references on the variant are now gone. It's as if the variant is trying to get rid of its overrides for some reason.
    Reimporting sometimes fixes the issue, but the fix is only temporary. Working on the prefab again will produce this issue again.
    Whenever this issue happens I check source control to make sure whatever was removed was indeed removed and I see that the prefab file changed in places I did not touch. The screenshot shows how random chunks were taken out of the prefab. I did not revert or remove these myself. I simple changed the position of a RectTransform that was in the base prefab


    I tried creating a repro project but couldn't reproduce this issue. We upgraded from Unity 2018.2 to 2018.4 in hopes of fixing this, but the issue seems to be a sticky one.
     
  2. ARGB32

    ARGB32

    Joined:
    Feb 20, 2013
    Posts:
    4
  3. TheTall2338

    TheTall2338

    Joined:
    Jul 5, 2015
    Posts:
    2
    Yes they are. But nothing in them is FormerlySerializedAs. The Monobehaviours themselves sometimes get removed, not just the references in them.