Unity build not loading correct scene 0

I have exactly one scene in the build settings, that being the scene that is currently open. When I build, however, a completely different scene is built. I know how Unity works, I’ve been using it for years, so it’s not because my build settings are wrong or because I accidentally added the incorrect scene to the build.

I’ve tried building multiple times for different platforms, I’ve restarted the engine several times and I’ve restarted my computer, so I’m not sure what else I could do. It makes working on scenes feel worthless as I wouldn’t be able to build them.

If it makes a difference, I used the “delete” key to remove the scenes from the build settings and one of them could have been active(checked) while I deleted them, which may be the cause of the problem. I’m not sure how I’d go about fixing this issue if this is, in fact, my problem.

Any help or suggestion would be greatly appreciated.

try to print build setting scene.

for(int i = 0; i < EditorBuildSettings.scenes.Length; i++)
{
Debug.Log (string.Format(“scene {0} enabled: {1}”, EditorBuildSettings.scenes_.path, EditorBuildSettings.scenes*.enabled));_
_
}*_

I tried updating and reinstalling Unity with no luck, leading me to believe that it was an error with the build settings in the project itself. After exporting all of the assets into a package and making a new project and importing the package again, everything worked.

What might have happened was that I tried to remove the list of inactive scenes from the build settings by pressing the delete key and doing that might have caused an error. So if this ever happens to everyone, this is a workaround to fixing the problem. You’ll need to reset all of your tags and layers, but afterwards, everything will work as planned!

  1. File → Build Settings.

  2. Right Click Scenes not loading → Remove Selection.

  3. Drag Scene Back into position.