Search Unity

Switching between Git branches & missing references on nested prefabs

Discussion in 'Prefabs' started by goran_okomotive, Feb 26, 2020.

  1. goran_okomotive

    goran_okomotive

    Joined:
    Apr 26, 2017
    Posts:
    60
    Dear Unity community

    We are experiencing some issues with exposed references to assets and components on nested prefabs.

    Follow scenario:
    We have a prefab with a MB on its root GO referencing inner prefab components and assets in the project folder. When we open that specific prefab in the prefab mode all links are visible. If it's nested we loose these references, even though no changes were made on the upper-level prefabs. Reverting doesn't help at all and it only occurs on machines of devs which have to switch quite often between git branches. The only way to solve it is to delete the Library folder and let Unity recreate it.

    I guess it has something to do with Unity caching some nested prefab logic in the Library folder and not detecting the git branch switch to other versions of the prefab?

    Is this a known issue or is there a other way to prevent it? It leads to quite a lot of bugs, since we are never 100% sure if somebody forgot to commit the references or if Unity wants us again to delete the Library folder.

    Cheers
     
  2. rise9912

    rise9912

    Joined:
    Feb 19, 2018
    Posts:
    10
    We have the same problem. Every time when I changing branches in the project (even if I close Unity before that). I have missing nested prefabs, and they missing only while in play mode. In editor I open a prefab and nested prefab is still here. It happens only in that prefabs that were changed compare to another branch. Only reimport all helps , but it's not a solution
     
  3. Sylvanas

    Sylvanas

    Joined:
    Jun 9, 2014
    Posts:
    6
    Same problem.
     
  4. nudz-klecany

    nudz-klecany

    Joined:
    Oct 6, 2015
    Posts:
    3
    2022 and the problem persists
     
  5. VResearch

    VResearch

    Joined:
    Jan 6, 2021
    Posts:
    21
    Same here. After switching branches, nested prefabs that got edited in the meantime go missing unless the scene and the parent prefab weren't committed with them (which is not always desirable)
     
  6. tmfconan

    tmfconan

    Joined:
    Oct 16, 2017
    Posts:
    8