- Home /
Why are m_SizeDelta and m_AnchoredPosition values changing in scene file for no reason, complicating merge?
I'm using UnityYAMLMerge with a version control system, and it works great, but it has exposed the fact that many m_SizeDelta and m_AnchoredPosition values in my scene are changing spontaneously, without my making the changes.
For example, I edit one object's x position and then save the scene. My coworker starts from the same version of the scene file I started with, and also edits one object's position. When we then attempt to merge our changes, UnityYAMLMerge shows us that besides the changes we made, there are many (usually eg. 45-200) objects in the scene file whose m_SizeDelta and/or m_AnchoredPosition values have changed (to different, conflicting values). For the most part the values have changed by a small amount, less than 1.0, but some show larger changes.
These spontaneous changes produce dozens of conflicts that we then need to resolve manually, making the process of merging a simple change in a scene file very time consuming.
Any idea why these m_SizeDelta and m_AnchoredPosition values are changing, and how to prevent it?
I'm having the same issue. One of our $$anonymous$$m saves a scene file, I reload it and instantly it's being marked that's something changed. I save the scene, look at the changes in a diff program (P4$$anonymous$$erge), and a whole host of m_SizeDelta + m_AnchoredPosition have changed.
It's very annoying, as like you say, it makes merging much more difficult (and people are saving + checking in the scene more often than needed)
I've moved your comment from "answer" to the comment section because it actually does not answer the question.
That said: I'm having the same issue and it is very annoying.
Same problem here. It occurs since I updated from 5.3 to 5.6. Very annoying :(
Have you filed this as a bug report with UT? See the answer by Logopolis and my comment to that answer for some more details that may help creating repro-steps for the issue. $$anonymous$$ost likely, it is an issue with Layout Groups, Content Size Fitters and serialization ... but it still is something that I would consider a bug.
Answer by Logopolis · Dec 01, 2016 at 10:36 PM
What I've gathered from looking through my scene file is that the gameobjects having their m_SizeDelta and m_AnchoredPosition changed automatically are those that are having their position and/or size set automatically due to being children of an object that has a Vertical (or Horizontal) Layout Group component, and a Content Size Fitter component.
Still don't know why it's changing these values between saves of the scene file (when I am not altering those objects at all between saves), or how to prevent it from doing so.
It does seem to be related to an issue I have seen with prefabs that use Layout Groups or Content Size Fitters: Often, those have those values stored as "0" in the prefab, so when you add the prefab to the scene, you may have to first change those values.
What I'm seeing, and what is very annoying, is that in our scenes, those values bounce from "0" to the "correct" value. So, I could save the change and commit while the "correct" values are there - but the next time that I open the scene, it might change them back to "0" and make the scene dirty / marked as changed in VC again. When this happens seems to be fairly random.
It may be a bug, are you working with latest Unity? btw, are you using a CanvasScaler? maybe you are chaning the game view (or have different game views in different machines) and the Canvas is updating itself based on that.
(or have different game views in different machines)
Of course each one of $$anonymous$$m members has different editor layout. Hello, we are in XXI century.
Your answer
Follow this Question
Related Questions
Git Version Control Merging 1 Answer
How to integrate a new version control plugin into Unity? 0 Answers
Edit->Project Settings->Editor Perforce Greyed Out 1 Answer
Git and Unity not working correctly: missing components, textures, materials, etc. 2 Answers
How to fix /Library/ conflicts in GitHub repo for Unity project? 1 Answer