Search Unity

Use Junction instead of Symlinks when "duplicating" projects or it'll break prefab references

Discussion in 'Prefabs' started by Whatever560, Nov 20, 2020.

  1. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I'm currently setting a "duplicate" project for several reason (building, testing, multiple local multiplayer clients). I usually do this by creating a link to the Asset, ProjectSettings and Package folders, then I can open this new project through unity.

    However my scene's prefabs and my variant where all loosing their root behaviour references.

    In a very strange manner, the prefab fields were empty in the hierarchy with no mention of the fields being overridden. However when editing the prefab the field values were back in line.

    I stepped on a lot of thread talking about prefabs loosing their references during build process or such and thought that what I found out might give hints to some people.

    Basically my intuition was it was related to the prefab fileId. I simply tried using a Junction instead of a Symlink and then reimported all the faulty prefabs. The problem was gone.

    So if anyone uses those kind of tricks for any reason (Endless Space 2 team used this for instance, so its really something you do to enhance process) think of trying Junctions instead of Symlinks.

    Best

    Related :
    https://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link
    https://forum.unity.com/threads/probably-serious-prefabs-bug-causing-losing-data-references.673318/
     
    dforstmaier likes this.