automatic decimal changes on UI elements?
I'm seeing a lot of unexplained behaviour on UI elements. When I open and immediately save a scene without any changes, my git tool shows changes such as these:
-m_Size: 0.9999981
+m_Size: 0.99999607
So somehow a change was done not as a result of my actions. I also have no editor scripts that would calculate or change properties on editor level. Additionally , the changes are on 6th digit position which is weird and seems to indicate a floating point precision differences on some calculations.
The bottom line is that when I open the scene and save it I end up with a ton of changes that actually don't do anything important but make it harder for me to sift through which files should be uploaded to repo.
Any ideas as to what is causing this? Is there a way to get around this?
As indicated, it's due to the lack of precision on floats, I don't think there is any way to change it.
But why is the value changing in the first place?
Because when you saiy to your computer "assign 0.9999981
to this variable" (during deserialization of the project), it's not able to assign the exact value (becaue it's not able to, due to lack of precision) resulting in this change in your version control system.
Your answer
![](https://koobas.hobune.stream/wayback/20220612171132im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I get rid of the yellow "Under Version Control" warning box? 1 Answer
API Keys in Collaboration/version control? 0 Answers
UI appearing in direction of a game object 0 Answers
How do I make a second UI text appear after a key press? 2 Answers
Resizing a 3d object to match the size of a UI element 0 Answers