Quick answer: SceneManager.LoadScene was given a name, path or index that matches no enabled scene in the scene list the editor or the build is using, and no loaded AssetBundle contains it. Open File > Build Settings (2022 LTS) or File > Build Profiles > Scene List (Unity 6), add the scene, tick it, and check that the string you pass is the scene’s file name without .unity.
You call SceneManager.LoadScene("Level2"), the screen stays where it was, and the Console prints a red line about build settings. Unity only loads scenes it was told to include, and it looks them up by name, path or index at the moment you ask. Adding the scene to the list fixes most cases in ten seconds. The rest are harder to spot: a duplicate scene name, an index that shifted, a build profile with its own list, a build script with a hard-coded array, or a scene that lives in an Addressables group. This guide covers each, plus a small editor script that catches the mismatch before you ship.
- The exact error
- What causes it
- How to find which cause is yours
- Fix 1: add the scene to the list the build uses
- Fix 2: stop typing scene names by hand
- Fix 3: replace raw indexes
- Fix 4: load bundled and Addressables scenes the right way
- Fix 5: make the build script use the same list
- A validator for scene name constants
- Why it works in the editor and fails in a build
- How to confirm the fix
- Catching it in builds you did not test
- Related guides
- Frequently asked questions
The exact error
In Unity 2022 LTS, loading by name prints this (two lines, one Console entry):
Scene 'Level2' 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...
Loading by index prints the same thing with the number in place of the name:
Scene with build index: 3 couldn't be loaded because it has not been added to the build settings.
To add a scene to the build settings use the menu File->Build Settings...
Unity 6 replaced the Build Settings window with Build Profiles, and its version of the message talks about the active build profile and the shared scene list and points you at File > Build Profiles. The opening, Scene 'Level2' couldn't be loaded because it has not been added to, is the stable part to search your logs for.
Unity logs this as an error and does not throw. A try/catch around LoadScene catches nothing, the current scene keeps running, and the code after the call still executes. SceneManager.LoadSceneAsync logs the same line and returns null, so the next thing you usually see is a NullReferenceException on operation.allowSceneActivation or operation.progress.
What causes it
- The scene is not in the list, or its checkbox is off. New scenes are never added automatically. An unticked scene stays visible in the window but is left out and gets no build index.
- The string does not match the scene’s file name. A typo, a trailing space,
"Level 2"forLevel2.unity, or a name built from a variable ("Level" + index) that runs past the last level. For scenes in the list the name is not case-sensitive, according to the scripting reference; for scenes that come from an AssetBundle it is. - A path in the wrong form. The documented forms are the bare name (
"Level2") or the path as the scene list shows it ("Assets/Scenes/Level2"), both without the extension. Backslashes, an absolute disk path or a path relative to some other folder match nothing. - The index moved.
LoadScene(3)means “the fourth enabled scene in the list”. Dragging a scene, unticking one above it or inserting a splash scene renumbers everything below. - A different list was used for the build. In Unity 6 a build profile can tick Override Global Scene List and carry its own scenes, so the Android profile and the Windows profile can disagree. On any version, a build script that passes its own array to
BuildPipeline.BuildPlayerignores the window entirely. - The scene is in an AssetBundle or an Addressables group. Those scenes are deliberately absent from the list.
SceneManager.LoadSceneonly finds them after their bundle has been loaded, and an Addressables scene should be loaded through Addressables. - Two scenes share a name.
Assets/Scenes/Level2.unityandAssets/Old/Level2.unity: loading by name picks the first match in the list. If the one you meant is the one not listed, you get either this error or the wrong level.
How to find which cause is yours
Ask the running game what it contains. Put this on a debug key or in your first scene and read the output in the Console, or in Player.log for a build:
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneListDump : MonoBehaviour
{
void Start()
{
int count = SceneManager.sceneCountInBuildSettings;
Debug.Log($"Scenes in this build: {count}");
for (int i = 0; i < count; i++)
Debug.Log($"{i}: {SceneUtility.GetScenePathByBuildIndex(i)}");
Debug.Log(Application.CanStreamedLevelBeLoaded("Level2"));
Debug.Log(SceneUtility.GetBuildIndexByScenePath("Assets/Scenes/Level2.unity"));
}
}
Read the result like this:
- The scene’s path is missing from the dump: causes 1 or 5. If it is missing only in the build, it is cause 5.
- The path is there but
CanStreamedLevelBeLoadedprintsFalse: the string is wrong (causes 2 and 3). Compare it character by character with the file name in the dump. GetBuildIndexByScenePathreturns-1: that exact path is not an enabled scene in this build. Any other number is the index to use.- The count is lower than the index you passed: cause 4.
If the numbers look wrong in the Unity 6 editor while a profile with its own scene list is active, update first: an editor bug in which GetBuildIndexByScenePath could ignore the profile’s list was fixed in 6000.0.60f1 and 6000.2.6f1.
Fix 1: add the scene to the list the build uses
Unity 2022 LTS: open File > Build Settings, open the scene, click Add Open Scenes (or drag the scene asset from the Project window into Scenes In Build) and make sure the checkbox is ticked. The number on the right is the build index.
Unity 6: open File > Build Profiles and select Scene List in the left column. That is the shared list every platform uses by default. Then click the profile you actually build with. If it has Override Global Scene List enabled, the scene must be in that profile’s list too, because the shared list is ignored for that profile.
The first enabled scene (index 0) is the one a build starts in. The editor starts in whatever scene you have open, which is how a missing boot scene goes unnoticed until the first build.
Fix 2: stop typing scene names by hand
The broken version usually looks harmless:
// Broken: the file is Level2.unity, and level 11 does not exist
SceneManager.LoadScene("Level 2");
SceneManager.LoadScene("Level" + (currentLevel + 1));
Keep the names in one place and check before loading:
public static class SceneNames
{
public const string MainMenu = "MainMenu";
public const string Level2 = "Level2";
}
public static class SceneLoader
{
public static bool TryLoad(string sceneName)
{
if (!Application.CanStreamedLevelBeLoaded(sceneName))
{
Debug.LogError($"SceneLoader: '{sceneName}' is not in this build.");
return false;
}
SceneManager.LoadScene(sceneName);
return true;
}
}
With a “next level” button, the false branch is where you return to the menu or show the credits. If two scenes share a file name, rename one, or pass the full path form ("Assets/Scenes/Level2") so the match is unambiguous.
Fix 3: replace raw indexes
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1) is fine for a linear game as long as you guard the end of the list:
int next = SceneManager.GetActiveScene().buildIndex + 1;
if (next < SceneManager.sceneCountInBuildSettings)
SceneManager.LoadScene(next);
else
SceneManager.LoadScene(SceneNames.MainMenu);
A literal such as LoadScene(3) breaks the day someone reorders the list. Use a name constant, or resolve the index from the path once with SceneUtility.GetBuildIndexByScenePath.
Fix 4: load bundled and Addressables scenes the right way
When you mark a listed scene as Addressable, Unity disables its entry in the scene list, so SceneManager.LoadScene("Level2") can no longer see it. Load it by its address:
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
var handle = Addressables.LoadSceneAsync("Level2", LoadSceneMode.Single);
For a plain AssetBundle, the bundle has to be loaded first. Until then Unity has no idea the scene exists:
AssetBundle bundle = AssetBundle.LoadFromFile(bundlePath);
if (bundle == null) { Debug.LogError($"Bundle failed to load: {bundlePath}"); return; }
string scenePath = bundle.GetAllScenePaths()[0];
SceneManager.LoadScene(scenePath);
In both cases the message at the top of this page means the content was not available at that moment: the bundle was not built for this platform, was not downloaded, or failed to load one line earlier. See Addressables failed to load for that side of the problem.
Fix 5: make the build script use the same list
A CI build that worked last month and now misses the new level usually contains this:
// Broken: nobody updated the array when Level2 was added
string[] scenes = { "Assets/Scenes/Menu.unity", "Assets/Scenes/Level1.unity" };
BuildPipeline.BuildPlayer(scenes, "Builds/MyGame.exe",
BuildTarget.StandaloneWindows64, BuildOptions.None);
Read the list from the project instead:
string[] scenes = EditorBuildSettings.scenes
.Where(s => s.enabled)
.Select(s => s.path)
.ToArray();
In Unity 6, EditorBuildSettings.scenes returns the active build profile’s list when that profile overrides the shared one, and the shared list otherwise. A script that switches profiles should read it after the switch.
A validator for scene name constants
Save this in an Editor folder. It compares every string in SceneNames with the enabled scenes and reports names that match nothing or match twice. Run it from the menu, or call SceneNameValidator.Validate() at the top of your build script.
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
public static class SceneNameValidator
{
[MenuItem("Tools/Validate Scene Names")]
public static void Validate()
{
string[] inBuild = EditorBuildSettings.scenes
.Where(s => s.enabled)
.Select(s => Path.GetFileNameWithoutExtension(s.path))
.ToArray();
FieldInfo[] fields = typeof(SceneNames)
.GetFields(BindingFlags.Public | BindingFlags.Static);
foreach (FieldInfo field in fields)
{
if (field.FieldType != typeof(string)) continue;
string sceneName = (string)field.GetValue(null);
int matches = inBuild.Count(n =>
string.Equals(n, sceneName, StringComparison.OrdinalIgnoreCase));
if (matches == 0)
Debug.LogError($"SceneNames.{field.Name} = \"{sceneName}\" is not an enabled scene.");
else if (matches > 1)
Debug.LogWarning($"SceneNames.{field.Name} = \"{sceneName}\" matches {matches} scenes.");
}
}
}
Why it works in the editor and fails in a build
Play mode is just as strict about LoadScene, so a pure “not in the list” mistake shows up in the editor too. The build-only cases come from the editor seeing more than the build does:
- You pressed Play in the scene that is missing from the list. It runs, because the editor plays any open scene. The build never contains it.
- The scene was already open additively in the Hierarchy, so your additive load looked like it worked.
- Addressables is set to the Use Asset Database play mode script, which reads scenes straight from the project. A build needs the content built and reachable.
- The build came from a script or a Unity 6 profile with a different list (cause 5).
There is more on this pattern in a scene that loads in the editor but is missing in the build.
How to confirm the fix
Make the build the same way your release is made (same profile, same script), run it, and walk every scene transition once: menu to game, each level to the next, death, back to menu, and the last level’s exit. Then search Player.log for couldn't be loaded because. Zero hits and the scene dump from the diagnosis step listing every scene you expect is the pass condition.
Catching it in builds you did not test
Because the message is a logged error, the Bugnet Unity SDK picks it up through Application.logMessageReceived and files it as a report with the game version, platform, OS and the log lines that led up to it. Reports with the same title stack, so a missing Level2 is one entry with an occurrence count, and a missing Credits is another. The game version on the report tells you which build shipped without the scene. What it cannot tell you is why: the report shows the player’s side, and the scene list, profile or build script that produced that build is something you check on your machine. If a player is stuck at a level exit and writes in through the in-game form, the same log lines are attached to their report.
Related guides
- How to Fix a Unity Scene That Won’t Load in a Build
- How to Fix a Unity Scene That Loads in the Editor but Is Missing in the Build
- Fix: Unity Build Missing Scenes or Resources at Runtime
- Fix: Unity Addressables Failed to Load Resource
- 12 Common Unity Errors and How to Fix Them
Frequently asked questions
Where are Build Settings in Unity 6?
Unity 6 replaced the Build Settings window with File, Build Profiles. The scenes are under Scene List in the left column of that window. A custom build profile can enable Override Global Scene List and keep its own scenes, so check the profile you build with as well as the shared list.
Why does my scene load in the editor but not in the build?
The editor can play any open scene, including one that is not in the scene list, and the Addressables Use Asset Database mode loads scenes straight from the project. A build only contains enabled scenes from the list it was built with, plus bundles that were built and loaded.
Is the scene name in SceneManager.LoadScene case-sensitive?
For scenes in the build’s scene list the scripting reference says the name is not case-sensitive. For scenes loaded from an AssetBundle it is. Matching the file name exactly, without the .unity extension, avoids the question on every platform.
How do I check if a scene exists before loading it?
Call Application.CanStreamedLevelBeLoaded with the scene name or index; it returns false when the build cannot load it. SceneUtility.GetBuildIndexByScenePath returns -1 for a path that is not an enabled scene in the build.
Can I catch this error with try/catch?
No. Unity logs it as an error and does not throw an exception, so the code after LoadScene keeps running. LoadSceneAsync returns null in the same situation, which usually causes a NullReferenceException on the next line. Check that the scene can be loaded before calling.
The window you look at and the list your build used are not always the same list. Dump the scene paths from the running build before you change anything else.