I’m working on my first multi-scene project and just by switching between my scenes Unity is asking me whether or not I want to save my changes, but I haven’t made any changes! I’m using Unity 5.5.2f1 and this is not reproducible in a new project and this only happens for 3 of 7 scenes in my current project and I have no idea why.
Anyone have any insight to share on this? I’ve tried Googling, but I haven’t been able to find anything.
I guess I need to start removing stuff from the scenes until I can narrow it down to what causes it, but it would be awesome if someone knew from experience why this is happening and more importantly how to avoid it.
Edit: This seems to be a bug with the Vertical Layout Group component in tandem with the Content Size Fitter Component. See my last reply.
There is an option that shows what assets get saved. It shows up all the time for me and I was surprised at first as prior to putting that on I didn’t realize it was saving. Mostly the project file if anything at all was touched. Sometimes it was that line endings got changed somewhere and it needed saving in VS Studio Code and Unity.
I’m sorry, but I don’t understand your reply. What’s “the project file” in a Unity project? And this is inside the Unity Editor, Unity has no way of editing code files so line endings shouldn’t matter or get changed.
I did some quick testing and my canvas is present in all 3 affected scenes. If I disable the canvas game object then I can freely switch between the scenes without getting the prompt to save changes, but if the canvas is enabled then I get the prompt. I still haven’t figured out what causes it, but I can check to see if I have that property set anywhere. There is a quadrillion scripts in the canvas hierarchy.
The VS project file. In Preferences i turned on Verify Saving Assets and it now shows me what it saves and it surprises me having worked with Unity so many years and that was going on without me knowing it was.
It’s the Vertical Layout Group component. If you have prefabs as children of a Vertical Layout Group on which you’ve ticked either “Control Child Size” width or height the scene will be marked as changed every time you open it.
But they apparently didn’t report it seeing as it’s still happening. So I did! My first bug report! I’m doing my part, are you?
Edit: Unity responded and I realized I gave them a poor repro-project. This also requires you to have a Content Size Fitter component on the parent game object as well. Edit 2: Unity confirmed it was a bug and it’s going to be fixed.
The same for me with Unity 2018.3.0f2
My Scene appears unsaved even by only switching from Unity to Visual Studio, then to Unity again.
I have to save it twice to get it unmarked.
A quick hack could be to round all floats before serializing rect transforms to some fraction of values, i.e. 0.001, ignoring the remainder. Been wanting to write an Editor extension for this for a while now.
Okay guys, did have the problem of scene that when your enter in it, it become dirty and must be saved.
I did browse my game objects by disabling them parent by parent, until I succeed to isolate the problem.
I did have in my UI canvas a Vertical layout, where one of the child did have the Aspect Ratio Fitter. There was actually a warning directly on the component to tell that it shouldn’t be there. (Undefined Results and conflicts)
2018.3.12f1 still has this bug. It is very critical in team work when you not sure is the changes were made by hands or because of bug. Waiting for fix!
Also a problem in 2017.4.32f. This is really interfering with teamwork and adding unnecessary verification steps to version control. Can’t coordinates just be rounded to some fraction, as spajus notes?
Looking at my last commit, rounding to 3 decimal places should fix it.
I just tracked this down in my project by toggling UI gameobjects on and off and saving. That really helped narrow it down to this content size fitter that has a similar warning.