Unity 6.3 auto refresh no longer works on Linux

I recently switched to Unity 6.3, as 6.2 reached end-of-support. I am running Linux Mint, which is a flavor of Ubuntu, so it should be supported.

After updating, I have found that the auto-refresh feature for assets has stopped working. If I change any asset outside of Unity (this includes scripts and image files), an asset refresh is no longer triggered.

I have already gone through all the common solutions. I made sure auto-refresh hadn’t somehow been switched off (it was still on), I checked the console for errors (there were none), I deleted the Library folder and .csproj files to trigger a cache rebuild, and I made sure VSCode was still set as my external script editor. I also checked on file permissions for my Unity project, and they don’t require root to access.

I went back to 6.2 to verify it was an issue with the new Unity version and not caused by a change to some other part of my system. The auto-refresh was still functional in 6.2.

I am aware that I can manually trigger a refresh with Ctrl+R, but I would really like for auto-refresh to work, as a manual refresh is just another thing for me to forget to do and wonder why my code changes aren’t working.

Edit: added Nition’s workaround as a solution for now, until Unity devs address this.

Is autorefresh also broken in a blank project?

Officially no, Mint is not supported. Ubuntu 22.04 and 24.04 are, and those are the only ones. Flavors or “based on” don’t count, it only increases your chances of Unity running without issues but ultimately, you never know as they’re still different and untested by Unity.

That’s too bad. Maybe I should try this on Ubuntu, then.

Autorefresh is still broken in a blank project.

Can confirm on Ubuntu 24.04. Having the same issue, all the solutions described by samboknight didn’t help me either.

If the project is blank or not, doesn’t matter.

In that case please report it: Help => Report a bug

Can confirm the issue on mint and fedora.

confirmed on debian. very annoying.

btw, this used to be a problem in previous versions too, just less so. sometimes I needed to deactivate/activate the unity window before it caught on. this is still the case, it has just gotten way worse.

Same problem here on Fedora KDE Plasma. Unity version 6000.3.7f1.

For now, here’s a script that detects asset changes and does a refresh manually, when not in play mode:

using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System;
using System.IO;

// Workaround for Unity 6.3 on Linux not auto-refreshing assets
// Put this in an Editor folder
// Uses FileSystemWatcher to detect changes
// Forces an AssetDatabase.Refresh once play mode is inactive
[InitializeOnLoad]
public static class AutoRefreshWorkaround
{
	static FileSystemWatcher fsWatcher;
	static bool isDirty;
	static double lastChangeTime;

	static AutoRefreshWorkaround()
	{
		if (EditorPrefs.GetBool("kAutoRefresh", true) == false)
		{
			// Respect Unity's own auto-refresh setting — if the user has it
			// disabled intentionally, don't override that.
			return;
		}

		string assetsPath = Path.GetFullPath("Assets");

		fsWatcher = new FileSystemWatcher(assetsPath)
		{
			IncludeSubdirectories = true,
			NotifyFilter = NotifyFilters.LastWrite
						 | NotifyFilters.FileName
						 | NotifyFilters.DirectoryName
						 | NotifyFilters.CreationTime,
			EnableRaisingEvents = true
		};

		fsWatcher.Changed += OnFileEvent;
		fsWatcher.Created += OnFileEvent;
		fsWatcher.Deleted += OnFileEvent;
		fsWatcher.Renamed += (_, e) => MarkDirty();

		EditorApplication.update += OnEditorUpdate;
		AssemblyReloadEvents.beforeAssemblyReload += Dispose;

		Debug.Log("[AutoRefreshWorkaround] Active — watching Assets/ for changes.");
	}

	static void OnFileEvent(object sender, FileSystemEventArgs e)
	{
		// Ignore .meta and hidden/temp files
		if (e.FullPath.EndsWith(".meta", StringComparison.OrdinalIgnoreCase))
			return;
		if (Path.GetFileName(e.FullPath).StartsWith("."))
			return;

		MarkDirty();
	}

	static void MarkDirty()
	{
		isDirty = true;
		lastChangeTime = EditorApplication.timeSinceStartup;
	}

	static void OnEditorUpdate()
	{
		if (!isDirty)
			return;

		// Don't refresh while in play mode
		if (EditorApplication.isPlaying || EditorApplication.isCompiling)
			return;

		// Only refresh while Unity Editor is the active application window.
		// Prevents focus stealing while editing in an external IDE.
		if (!InternalEditorUtility.isApplicationActive)
			return;

		// Wait until changes have settled
		const double WAIT_SECONDS = 1.0;
		if (EditorApplication.timeSinceStartup - lastChangeTime < WAIT_SECONDS)
			return;

		isDirty = false;

		Debug.Log("[AutoRefreshWorkaround] File changes detected — forcing AssetDatabase.Refresh.");
		AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate);
	}

	static void Dispose()
	{
		if (fsWatcher != null)
		{
			fsWatcher.EnableRaisingEvents = false;
			fsWatcher.Dispose();
			fsWatcher = null;
		}
	}
}

Edit: Updated the script to not run unless Unity is the active window. Stops Unity stealing focus to do its refresh.

I’m also seeing this issue on Ubuntu 24.04, after updating to 6000.3.7f1.

cool, thanks!!!

Im getting this on Unity 6000.3.9f1.

Is there a bug report to vote?

Edit: Also curious if this also happens on further versions? 6.4 →

I’ve started running into a problem with this where it will sometimes detect that a script was updated (the message about forcing a refresh is printed), but fail to trigger a recompile. In this case, Ctrl+R won’t make it recompile either. The only way I can get a recompile when this happens is to manually reimport the script I updated.

I’ve found similar cases, or even worst, sometimes, for some reason the compilation is triggered several seconds afterwards, producing all sort of daily workflow annoyances.

So what I ended up doing was to just add a couple buttons to the Unity toolbar, one of which is a manual recompile call (CompilationPipeline.RequestScriptCompilation()). For convenience, I also added the refresh as well.

So those are my fallback options, because in vscodium the Unity extension signals the recompile on save, so most cases get automatically handled anyway, but I got ready tools for hard cases.

It looks like the workaround script is triggering an assembly lock.

When the recompile fails to trigger, a lock icon appears in the bottom right of the main Unity window. When I hover over it, a tooltip appears that says assemblies are locked. After waiting a couple seconds, I can click on the lock icon to make it go away, and then the scripts recompile.

Restarting Unity does not solve this.

Edit: This only occurs while the assembly is in debug mode. In release mode, it works as expected.

Edit 2: After installing the latest version of VSCode, this no longer occurs, so it must have been a problem caused by that.