Symptoms
- The root canvas in my Scene has an Aspect Ratio Fitter added onto it, which is causing my Scene to be marked as dirty.
Cause
The Scene becomes dirty because of the canvas wanting to set the size of its RectTransform. Due to the Aspect Ratio Fitter also changing the size during the initialization, the Scene becomes dirty and leads to an unsaved change.
Resolution
You can still use the Aspect Ratio Fitter but need to place a new, empty GameObject below the canvas group. Moving the Aspect Ratio Fitter from the root canvas group to the new, empty GameObject will stop the Scene from being marked as dirty.
More Information
For more information, consult the Unity Aspect Ratio Fitter documentation.
Comments
6 comments
Is this a practical joke? I feel like this is a prank...
This seems like a bug in Unity and the suggested fix feels like a hacky workaround I'd expect from a user's blog, not from the owners of the source code.
Also, it doesn't work. It DID stop my scene from being marked as dirty. Cool. But it also made my Aspect Ratio Fitter stop fitting. Bummer.
This is driving me crazy... constant scene changes, making it a pain to work with git....
First time using Aspect Ratio Fitter and it constantly changes the scene. What a nightmare. Crazy that it's been this way for AT LEAST 3 years. Oh Unity...
Same issue on Unity 2019.2.12.
Issue still here in Unity 2019.3.5f1
Issue still here in Unity 2018.4.19f1
Please sign in to leave a comment.