Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by caulfield85 · Jan 05, 2018 at 03:37 PM · scenescene-switching

Unity keeps asking to save a scene

Every time I switch scenes int Unity, it will ask if I want to save the changes I've made to a scene, even though I didn't make any. I noticed this started happening after I updated. Could it just be a bug or could there be another reason?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image acclogin71 · Jul 20, 2018 at 04:55 PM 0
Share

facing same problem. you got solution yet?

6 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by eddyspaghetti · Oct 08, 2018 at 03:45 PM

I know this is a little old, but this has been happening to me in 2018.2.0f2. I registered a callback with the Undo system to try to figure out what's happening using the code below (in one of my editor classes). When I add this, I can see what undo-able changes are happening to the scene. In our case the issue is that Unity is making tiny changes to the anchor positions of the Handle game object for a scrollbar in our UI. It's stuff like:

"Changed value for target Handle:m_AnchorMin.y to 0.0000004172325 from 0.0000011324883"

I haven't figured out how to suppress tiny changes, but at least I've ruled out issues with our own code.

 public static bool TrackSceneChanges = false;

 public static void EnableSceneDirtyChecker() 
 {
     if (!TrackSceneChanges)
     {
         Undo.postprocessModifications += OnPostProcessModifications;
         TrackSceneChanges = true;
     }
  }
 
 public static void DisableSceneDirtyChecker()
 {
     if (TrackSceneChanges)
     {
         Undo.postprocessModifications += OnPostProcessModifications;
     }
 }

  public static UndoPropertyModification[] OnPostProcessModifications(UndoPropertyModification[] propertyModifications) 
 {
     Debug.Log("Dirty!");
     foreach (UndoPropertyModification mod in propertyModifications)
     {
         Debug.Log($"Changed value for target {mod.currentValue.target.name}:{mod.currentValue.propertyPath} to {mod.currentValue.value} from {mod.previousValue.value}");
     }

     return propertyModifications;
 }
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lhg · Oct 11, 2018 at 12:24 PM 0
Share

I have VSTS (souce control) in my project and I checked When I open my scene Unity immediately mark it as unsaved. If I save and then check in the source control what has changed it is the same thing: Some object's anchor changed from 0 to 0.0000324. And everytime I open the scene it keeps changing a few decimal values. This generates garbage to my project's source control all the time...

I still haven't found the reason that unity is doing/generating this floating values.. I'm using Unity 2018.2.5

avatar image
0

Answer by OneCept-Games · Jan 05, 2018 at 04:10 PM

Could be that some Editor scripts are changing your scene objects. Do you have your own- or Asset Store purchased Editor scripts in your project?

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image caulfield85 · Jan 05, 2018 at 04:28 PM 0
Share

I don't think so. I have downloaded a few things from the store but I think I've deleted them all because I don't use them anymore.

Could EditorUtility.SaveFilePanelInProject be causing the problem?

avatar image OneCept-Games caulfield85 · Jan 05, 2018 at 04:53 PM 0
Share

No build in Editor scripts should cause this. Speaking of saving a scene, i use this script to actually remember to always save on Play. It might help you in this case also, because then it saves automatically - at least on Play, and you might be able to change it to save on Close by using EditorScene$$anonymous$$anager.SceneClosingCallback. using UnityEngine; using UnityEditor; using UnityEditor.Scene$$anonymous$$anagement;

 namespace OneCept {
     
     [InitializeOnLoad]
     public class SaveOnPlay
     {
         static SaveOnPlay()
         {
             EditorApplication.playmodeStateChanged += SaveCurrentScene;
         }
 
         static void SaveCurrentScene()
         {
             if (!EditorApplication.isPlaying && EditorApplication.isPlayingOrWillChangePlaymode)
             {
                 //Debug.Log("Saving scene on play...");
                 EditorScene$$anonymous$$anager.SaveOpenScenes();
             }
         }
     }
 }
avatar image
0

Answer by Thaun_ · Jan 05, 2018 at 04:52 PM

No, there isnt any bug with that. Lets say you havent changed anything, you think you havent changed anything, but Unity itself might have automaticly did tiny tiny changes that it needs to be saved. Dont worry, but we suggests that you keep saving it.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image caulfield85 · Jan 05, 2018 at 07:27 PM 0
Share

I just wish it wouldn't! Its very annoying when I have to switch between a few scenes and I keep getting the popup to save for each one

avatar image Thaun_ caulfield85 · Jan 05, 2018 at 08:28 PM 0
Share

Well, the quick way is to just press Enter

avatar image
0

Answer by wlwl2 · Nov 07, 2018 at 07:06 PM

@caulfield85 @eddyspaghetti this bug (it is a bug!) happens on Unity 2018.1.5f1 as well. I guess that it has something to do with UI layout. For me the solution was to disable the child (with the layouts) in my root UI game object (I only use one UI canvas and have its children heavily nested). Something in that child is causing this issue I guess, I use layouts a lot inside it (it's a menu). I'll update my answer when I figure it out.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Tulsisvt · Jan 09, 2019 at 03:10 PM 0
Share

I have the same issue with 2019.1.0a9 with a canvas in the scene. It's annoying to keep discarding changes in my git

avatar image
0

Answer by BV123 · Jan 24, 2020 at 11:05 PM

Layout->Revert Factory Settings->Restart Unity worked for me.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

92 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Asynchronously Load a Scene, then switch to it on function call Unity 5.3 1 Answer

SceneManager onActiveSceneChange Pause for a while before loading a new scene 0 Answers

Make a scene continue running in background 1 Answer

SceneManager.LoadScene not working with button 1 Answer

Everytime when i start at level 3 or higher after completing it it goes back to level 2 how do i fix this? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges