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

Prefabs inside Layouts causing change to scene on load

Discussion in 'UGUI & TextMesh Pro' started by matiasticbits, Mar 20, 2017.

  1. matiasticbits

    matiasticbits

    Joined:
    Jan 3, 2017
    Posts:
    30
    When I load my UI scene Unity instantly tells me that there are changes in the scene. Looking in to the diff of the scene file I can see these problems are usually appearing under a Layout object using prefab instances as a child. An example of a change caused by this behaviour:
    Code (CSharp):
    1.      - target: {fileID: 224583572312705704, guid: 19c71dcafab3f4d83967cee0c6bb398e,
    2.          type: 2}
    3.        propertyPath: m_AnchoredPosition.y
    4. -      value: -817.7499
    5. +      value: 0
    6.        objectReference: {fileID: 0}
    7.      m_RemovedComponents: []
    8.    m_ParentPrefab: {fileID: 100100000, guid: 19c71dcafab3f4d83967cee0c6bb398e, type: 2}
    This value in this particular case seems to jump back and forth between 0 and and -817.7499.

    This is not a huge problem but an annoying one when having more than one developer editing scenes. You can't only change couple attributes in a scene, because saving the scene will cause multiple automatical changes and these changed attributes are the same attributes that are constantly changing for other developers also. Has anyone else ran into this and found a solution?
     
    JeromeJ and EirikWahl like this.
  2. msklywenn

    msklywenn

    Joined:
    Nov 28, 2014
    Posts:
    67
    Same thing happens to us. I find it very annoying since it makes very difficult to know if you should commit the scene or revert it... It happens for hundreds of values in our menu scene.

    Did you ever find a solution ?
     
  3. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    This has been a bug for quite a while now. They actually fixed it in the very first release of 2017.2, but the fix caused a bunch of other UI bugs, so they reverted and undid the fix in the first patch 2017.2.0p1. They're releasing a new version, 2017.2.1, today but I don't see anything about UI fixes in the last three patches so I think they gave up on trying to fix the UI for now. The fix isn't int 2017.3 yet either, so it looks like maybe we'll have to wait for some future 2018 version.
     
  4. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    You confirmed what I thought was true, about them wanting to fix this or what not. I didn't know that the fixed messed up other things and will now not be available for a while, though. lol That's a shame.


    Note, what I used to do (and is not perfect/as good as a real fix), is break my prefab instance(s). Sure, this is a bit more management, in some ways, but it prevented this scene change stuff. =)