Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

SVN and missing scripts

Discussion in 'Editor & General Support' started by andyz, Oct 6, 2014.

  1. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,124
    There seems to be some sort of bug that leads to occasional missing scripts/monobehaviours on prefabs when we share projects through svn. We setup things exactly as per the docs for source control and mostly it works ok but it appears that for many people when they load up the project for the first time some scripts get their GUID changed and so they can no longer be matched up to the prefab which now points to a non-existent GUID.

    They then have to have the scripts manually re-attached so they can work on the project, which is annoying.
     
  2. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    What Asset Serialization mode are you using? Usually "Force Text" is (or at least was) more safe.
     
  3. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,124
    Yes have done that now, but still it just seems a not very robust system - only referencing items by GUID can easily break if an item gets assigned a new one for some reason as seems to be happening at times with scripts - if a filename was also stored it might at least attempt to find the missing asset.
     
  4. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,489
    See this docs page of mine on how the GUID works in the Asset Database. It might help you understand what's happening and why a little more clearly: http://guavaman.com/projects/spritefactory/docs/pages/WorkingInMultipleProjects.html

    If those scripts are reassigned GUIDs and you manually reattach them, that will only cause more problems when you import them into another project. You really want to have those GUIDs consistent across all projects. Instead of reassigning them, fix the GUIDs.
     
  5. superpig

    superpig

    Drink more water! Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,613
    Are people on your project submitting new scripts to SVN without letting Unity import them first, by any chance? If you do that then Unity doesn't have the chance to generate the initial .meta file for the script, so it doesn't get submitted along with the script file. Then, as other team members pull the script from SVN, they generate their own .meta files locally, with different GUIDs - and thus anything referencing those scripts won't work properly.
     
  6. andyz

    andyz

    Joined:
    Jan 5, 2010
    Posts:
    2,124
    I think you just about hit the nail on the head - people have not submitted some meta files or ignored them in version control! Thanks for suggestions
     
    superpig likes this.