Scene immediately marked as dirty on open

Is there a way to find out why a scene is immediately marked as dirty when I open it?

If you’re using version control it’s pretty easy:

  • Save all changes
  • Close the scene
  • Commit all changes to VC (e.g. git commit -am “some message”)
  • Open the scene
  • Since it’s dirty, you can now save all changes again
  • Check with your version control what changed (e.g. git diff)

In my experience it’s usually something like pixel perfect canvas elements.

4 Likes

Agree with Praetor… and sometimes the reason is anchors fighting with layouts… if you scan through your layouts and find anything with like 0.99999 (or 1.00001) scale set it to 1, or if you see something that has a position like 1.43323e-7, just set it to zero… those are often indicative of something fighting between RectTransforms.

2 Likes

Could also be an editor script, though the above suggestions are considerably more likely.

Thanks for the suggestion! It looks like SourceAssetDB is changing when I load a scene. Not sure what’s going on there.

1 Like

Ah I think it was fighting with layouts. I’ll go through and try to find any weird values in my rects. Thanks!