Runtime exceptions
Scene 'X' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
The exact message
Scene 'X' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.Variants of this message
- couldn't be loaded because it has not been added to the build settings
- couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded
- To add a scene to the build settings use the menu File->Build Settings...
- Scene '' couldn't be loaded because it has not been added to the build settings
- Scene 'Assets/Scenes/Level1.unity' (-1) couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
What it means
Unity could not resolve the name or path you passed to SceneManager.LoadScene against its list of scenes in the build. Only scenes ticked in the Build Settings window are compiled into the player and available at runtime, and the lookup is done against the path recorded when the scene was added, not against whatever is on disk now. The bracketed number in the message is the build index Unity found, and -1 means it found nothing at all.
Causes and fixes
Ranked by how often they actually occur, most common first.
The scene was never added to the Build Settings list
By far the most common case, and the one the error message is written for. A scene that exists in your Assets folder and opens fine in the Editor is still not part of the build until you add it. Play mode in the Editor is more forgiving than a build in some workflows, so this often surfaces the first time you test a scene transition.
The fix: Open File > Build Settings (File > Build Profiles > Scene List in Unity 6 and later), then drag the scene from the Project window into the Scenes In Build list. The scene you want to start on must be at index 0.
The scene is in the list but its checkbox is unticked
The Scenes In Build list shows every scene you have added, each with a checkbox. Unticking a scene leaves it visible in the list but excludes it from the build, and it is then not loadable at runtime. This reads as a paradox because the scene is plainly there on screen.
The fix: Tick the checkbox next to the scene in the Scenes In Build list. Only ticked scenes are assigned a build index; unticked ones report -1.
Confirm what the runtime can actually see, rather than trusting the Editor window.
using UnityEngine; using UnityEngine.SceneManagement; public class SceneListDump : MonoBehaviour { void Start() { Debug.Log($"Scenes in build: {SceneManager.sceneCountInBuildSettings}"); for (int i = 0; i < SceneManager.sceneCountInBuildSettings; i++) { string path = SceneUtility.GetScenePathByBuildIndex(i); Debug.Log($"[{i}] {path}"); } // -1 means the name or path resolved to nothing. Debug.Log($"Index of 'Level1': {SceneUtility.GetBuildIndexByScenePath("Level1")}"); } }Source: Unity Discussions: scene IS added to build settings, error persists
The string does not match the scene name or path
LoadScene accepts either the scene name with no .unity extension, or the path exactly as shown in the Build Settings window, also without the extension. It does not accept a partial path, and it does not accept the name with the extension attached. Matching is case insensitive, except when the scene comes from an AssetBundle. A single wrong character, including a space in "Level 1" where the asset is called "Level1", produces this error.
The fix: Pass either the bare scene name or the full path as the Build Settings window displays it. Where two scenes share a name in different folders, you must use the path, because the name form loads the first match in the list.
All three forms below are valid; the fourth is not.
using UnityEngine.SceneManagement; SceneManager.LoadScene("Level1"); // name only SceneManager.LoadScene("Scenes/Level1"); // path as shown in Build Settings SceneManager.LoadScene(2); // build index SceneManager.LoadScene("Assets/Scenes/Level1.unity"); // fails: extension included // Safer than a bare string: fails loudly at the call site rather than // silently doing nothing. public void Load(string sceneName) { if (SceneUtility.GetBuildIndexByScenePath(sceneName) < 0) { Debug.LogError($"'{sceneName}' is not in the build settings.", this); return; } SceneManager.LoadScene(sceneName); }Source: Unity Scripting API: SceneManager.LoadScene, sceneName rules
The scene was moved or renamed after it was added
The Build Settings list stores each scene by asset path. Moving a scene into a different folder, or renaming it, leaves a stale entry pointing at a path that no longer exists. The window may still show the scene, so this is the second case that reads as a contradiction. Reorganising a Scenes folder partway through a project is the usual trigger.
The fix: Remove the stale entries from Scenes In Build and drag the scenes back in from their new locations. Re-adding is required; the list does not follow asset moves.
Source: Unity Discussions: moving scenes between folders requires re-adding them
An empty or uninitialised string reached LoadScene
The message quotes the name it was given, so an error reading Scene '' with nothing between the quotes means the string was empty. This usually comes from a serialised field that was never filled in the Inspector, or from a lookup that returned null and was concatenated into the call.
The fix: Read the quoted name in the message. If it is empty, the bug is upstream of LoadScene: trace where the string comes from and check the Inspector field or lookup that produces it.
Source: Unity Discussions: host receives Scene '' couldn't be loaded
A custom build script does not set the scene list
BuildPipeline.BuildPlayer takes its scenes from BuildPlayerOptions.scenes, not from the Build Settings window. A CI or automated build that leaves that array unset, or sets it from a stale list, produces a player whose scene list differs from what the Editor shows.
The fix: Populate buildPlayerOptions.scenes explicitly, or derive it from EditorBuildSettings.scenes so the automated build and the Editor agree.
Derive the list rather than hardcoding it, so the two cannot drift.
using System.Linq; using UnityEditor; var buildPlayerOptions = new BuildPlayerOptions { scenes = EditorBuildSettings.scenes .Where(scene => scene.enabled) .Select(scene => scene.path) .ToArray(), locationPathName = "Builds/Game.exe", target = BuildTarget.StandaloneWindows64, }; BuildPipeline.BuildPlayer(buildPlayerOptions);Source: Unity Discussions: custom build script must assign buildPlayerOptions.scenes
An invisible character in the scene name
Rare, and worth checking only once the causes above are ruled out. A scene name containing a non-breaking space (U+00A0) rather than an ordinary space looks identical in the Editor but does not match a string typed in code. Names pasted from a document or a chat window are the usual source.
The fix: Rename the scene by typing the name fresh rather than pasting it, then re-add it to the Build Settings list. Comparing SceneUtility.GetScenePathByBuildIndex output against your literal in a diff tool will expose the mismatch.
Source: Unity Discussions: scene name contained Unicode 160, a non-breaking space
How to prevent it
Do not pass scene names as bare string literals scattered through your code. Generate a constants class from the Build Settings list, or serialise a SceneAsset reference in the Inspector and read its name, so a rename or a typo becomes a compile error rather than a runtime one.
Add a guard at your single scene-loading entry point that checks SceneUtility.GetBuildIndexByScenePath before calling LoadScene. A logged error naming the offending scene is far quicker to diagnose than a transition that silently does nothing.
Re-check the Scenes In Build list after any reorganisation of your Scenes folder, and treat it as a file that needs reviewing in pull requests. EditorBuildSettings is serialised in ProjectSettings/EditorBuildSettings.asset, so changes to it show up in version control.
Unity version differences
The message text has been stable across Unity 2019 through Unity 6. In Unity 6 the scene list moved from File > Build Settings to File > Build Profiles, where it appears as the Scene List section, but the runtime behaviour and the error are unchanged.
Related errors
- Referenced script is missingWhy Unity reports a missing script on a GameObject, how to find which object it is, and the five causes from deleted files to broken .meta GUIDs.
- NullReferenceExceptionWhy Unity throws NullReferenceException, how to read the stack trace to find the exact line, and the five causes that account for nearly all of them.
- MissingReferenceExceptionWhy Unity says an object has been destroyed but you are still accessing it, how destroyed objects differ from null, and the four causes worth checking.
Related tools
Sources
- Unity Scripting API: SceneManager.LoadScene
- Unity Scripting API: SceneUtility.GetBuildIndexByScenePath
- Unity Discussions: scene IS added to build settings, error persists
- Unity Discussions: host receives Scene '' couldn't be loaded
- Unity Discussions: custom build script must assign buildPlayerOptions.scenes