Is it possible to program UNITY so that every 5 minutes it makes an automatic recording of the project?
thank you
Probably easily done using the editor-coroutine package to have a coroutine always spinning and saving all assets now and again.
Though not sure how this would interact with other processes that hold up the editor, like domain reloads. Or non-blocking processes.
Exactly. I believe it works through EditorSceneManage which should have a save method.
But … this will create a terrible workflow. It‘s better to get in the habit of pressing Ctrl+S frequently and you can even remap that to some other key, possibly even weird stuff like Ctrl+MiddleMouseButton.
The issue with autosave is that it will get in the way in the worst of times, like you want to finely adjust an object‘s transform and suddenly the editor freezes for 2 seconds and due to the delayed interaction the object is now wildly out of place.
Or you simply made changes that you specifically do not intend to save. Do test whether saving clears the undo historyirst, because if that’s the case autosave is a terrible idea. You don‘t want to get in that spot where you moved stuff around and want to undo most recent changes, but then autosave happens and now you have to manually out everything back in place because the undo buffer got cleared.
thanks a lot … really thanks.
Sure, we all know regular saving is a good thing. But it’s easy to forget, and the tiny little star marker in the title is not much reminder that you’ve forgotten your good saving hygiene. A good middle ground would either be a much more visible static reminder (even, just, *** instead of *), or better yet a countup timer showing how long since the last save.
Given how extensible the unity editor is, it seems like that might be possible?
let’s not get all high and mighty, we’ve all lost stuff we wanted to keep at some point in our lives because we didn’t save at the right time.
There are autosaving tools, and it‘s easy to write one yourself in like 10 lines of code.
BUT this isn‘t a solution as anybody will tell you who worked on complex editing software (eg video or audio, modeling or design). The interruption of the workflow is very annoying and can lead to issues in itself - imagine a laggy drag & drop oooops where did it go?
The other thing is, as far as I recall saving will clear your undo history. So if you‘re in the middle of experimenting and that gets saved you‘ll have to manually backtrack and clean up.
No, the problem is sitting in front of the monitor. Lose your scene once, shame on Unity. Lose it twice, shame on you. Some have developed the good habit of Ctrl+S frequently. Others revel in pain, and try to overcome it by replacing it with another pain. ![]()
If you weren’t so busy saying the exact same thing you already said for 2nd time, you’d have read my suggestion was making it more clear that there were unsaved changes.
You have this asterisk. It‘s customary in almost every application. That and remembering that you did make changes and possibly enabling scene autosave when entering playmode (that’s a setting if I recall correctly) should suffice.
Except that plenty of people have this issue, suggesting it’s not sufficient for them. Perspective taking, much?
Meanwhile it’s undeniable that Unity does a poor job of making the unsaved changes * as visible as in other apps. Here’s just a single example from an app I know you’ve used.

If plenty is a not-insignificant number, you’ll find solutions if you go looking. ![]()
Otherwise it’s likely not that many.
True, the UX of that marker could be improved.
Yes, absolutely. Because … this is a trivial thing thanks to editor scripting. Took me about 15 minutes to write my own visual improvement just to prove this point. ![]()
After Ctrl+S:
You can make that window even smaller or maybe even make it part of the Hierarchy window itself or add it as an Overlay or EditorTool in the scene view or make the text scroll and blink and also flash the color red-white at high frequency while the scene isn’t saved to make it stand out even more or … near limitless options.
The code for this:
using System;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UIElements;
namespace CodeSmileEditor
{
public class SceneUnsavedChangesMonitor : EditorWindow
{
private Label m_Label;
private Scene m_ActiveScene;
private Boolean m_IsActiveSceneDirty;
[MenuItem("Tools/Scene Unsaved Changes Monitor")]
private static void ShowWindow()
{
var window = GetWindow<SceneUnsavedChangesMonitor>();
window.titleContent = new GUIContent("Scene Unsaved Changes Monitor");
window.Show();
}
private void CreateGUI()
{
m_Label = new Label();
m_Label.style.color = Color.black;
rootVisualElement.Add(m_Label);
var activeScene = EditorSceneManager.GetActiveScene();
UpdateLabel(activeScene.IsValid() && activeScene.isDirty);
}
private void Update()
{
var activeScene = EditorSceneManager.GetActiveScene();
if (activeScene != m_ActiveScene)
{
m_ActiveScene = activeScene;
m_IsActiveSceneDirty = activeScene.IsValid() && activeScene.isDirty;
UpdateLabel(m_IsActiveSceneDirty);
}
if (activeScene.IsValid() && activeScene.isDirty != m_IsActiveSceneDirty)
{
m_IsActiveSceneDirty = activeScene.isDirty;
UpdateLabel(m_IsActiveSceneDirty);
}
}
private void UpdateLabel(Boolean isDirty)
{
if (isDirty)
{
m_Label.style.backgroundColor = Color.red;
m_Label.text = "Scene has unsaved changes!";
}
else
{
m_Label.style.backgroundColor = Color.green;
m_Label.text = "Scene is saved.";
}
}
}
}
PS: the setting about saving the scene(s) I mentioned earlier is not for entering playmode but rather to ensure all scenes are saved before making a build.
You could however take the compile possible script changes on enter playmode when auto-refresh is disabled code fragment and change it so that it calls EditorSceneManager.SaveOpenScenes().
Thank you, that’s a good solution. I had tried to roll my own variation on unity’s title bar * with
but it seems like the access to that function has been clamped down since the docs were written:
“‘ApplicationTitleDescriptor.title’ is inaccessible due to its protection level”
Your solution is much more visible, if at the cost of taking up UI space that could have been used for something else, unlike the mostly empty window title bar.
In general it seems like the top ~100 pixels of the unity window are poorly utilized, and while it seems like there are ways to put stuff there, such as in the toolbar, it relies on semi-documented hacks?
Inspired by your code and realizing the tab title itself could be used to deliver the warning, I hacked together this result:
it uses events so it’s ultra light weight and fills pixels that were going to be blank, at least on my screen. Good enough for me.
| EditorSceneManager.sceneDirtied += OnSceneDirtied; | ||||
|---|---|---|---|---|
| EditorSceneManager.sceneSaved += OnSceneSaved; |
code is very hacky but if I spent 5 minutes cleaning it up I’d be happy to share if anybody wants it.


