Search Unity

Scene variables not being transferred by version control

Discussion in 'Editor & General Support' started by Brian_C, Nov 4, 2011.

  1. Brian_C

    Brian_C

    Joined:
    Nov 4, 2011
    Posts:
    6
    Hi there.

    We're using Perforce Version Control but we're having trouble when saving scene files. We find that if we edit public variables in a script component (such as setting the image for a Texture2d) and then submit the scene file to the depot, other users will not always get these changes. Sometimes making a small change, and re submitting works but not always.

    We have checked that there are not other files in the assets folder or library that have changed.

    Has any one else seen this of does anyone have any ideas what we may do to fix this?

    Thanks for all your help,
    Brian :)
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you change the scene it should always transfer

    If it does not transfer you potentially updated prefabs and used apply and considered that to be enough, but in reality you must also save the scene or prefabs won't be saved.

    Generally you should also close down unity so the cache etc is really up to date, I would not recommend to do commits while the editor is running for this project
     
  3. justinlloyd

    justinlloyd

    Joined:
    Aug 5, 2010
    Posts:
    1,680
    Using Perforce on one professional project and SVN on another professional project. Before you sync, shut down Unity, sync, then open it back up. Before you commit, save your project, shut down Unity, commit, restart Unity. That's the only 100% reliable workflow we have found so far. Otherwise you get weird little quirks here and there which can be especially problematic in a large scene with many objects if one of the updated values did not get saved out correctly. Looking forward to the new 3.5 Perforce SVN integration that will hopefully remove some of those issues.
     
  4. Brian_C

    Brian_C

    Joined:
    Nov 4, 2011
    Posts:
    6
    Ah, we found the problem. Kind of silly really, when the image in question was committed the .meta file was not. Unity created it's own but when the Scene file was updated and reloaded the meta files must have differed and the texture reference was removed from the script.

    Thanks for all the advice though, I think we will make sure we close Unity when syncing and committing now. I am looking forward to the 3.5 update though :)
     
  5. justinlloyd

    justinlloyd

    Joined:
    Aug 5, 2010
    Posts:
    1,680
    You and me both mate. :)