Hi everyone,
I am getting the error “Scene couldn’t be loaded because it has not been added to the build settings” despite the fact that the scene IS in the build settings, and ticked.
My code to load the scene is as follows:
void genericLoadScene(string sceneName, List<string> parameters)
{
SceneManager.LoadScene (sceneName+"");
}
As you can see by the presence of sceneName+“”, I am definitely passing it a string, not a variable name.
The error occurs with specifically this scene. All other scenes work fine.

I have checked the string that I am passing in to ensure it is correct many multiple times.
What am I doing wrong, please?
I have tried reordering the scenes
7 Answers
7
TIP: If it is not about whitespaces, then it might be that you have move your scene to another folder in the hierarchy. Build Settings seems to adapt this new folder, but you actually have to re-drag your scenes into the Build Settings, else you will have this error also.
Just a tip if you happen to meet this issue again later when you are sure there are no spaces and spelling issue.
After having iterated through all characters in the two strings, I have found the answer! Unfortunately, my scene had a space in it; although, it wasn’t a ‘proper’ space, as in unicode 32. In fact, it was unicode 160; a non-break space.
Note for the future: Don’t use spaces!!
Actually…(I just ran into it after getting my own Collaborated project from one system to another), it has to do with the fact that the project doesn’t seem to like the items already in the list in the Buildscreen. Easiest is to remove all scenes and add them again. No need to change the code. The project will then be able to find the items again.
One issue I’ve learned is that when you take the name as a string from another object… if the object is a texture file (maybe others as well), it may associate that to the name. I learned this because I manually added the name of the file and it worked, yet when I try it with the string, the debug.log description has (UnityEngine.Texture2d) attached to the string output. Still trying to find the right solution for that, but I’m sure it won’t be long before I do. Good luck!
This Helped Me! Thank You!
I moved the scene to another folder and then it worked.
it happened to me aswell if your scenes are in a folder try including the folder name for it to work also dont forget to add your scenes in the File/Buildsetting :
the following code should be smt like this :
public void GotoLevelSelect()
{
SceneManager.LoadScene(“Scenes/LevelSelect”,LoadSceneMode.Single);
}
try loading it by number instead of the name.
– ShadyProductionsIf you already implemented. you can store there email or id inside your app and use that as your identifier. right?
– P3JX