Application.LoadLevel not working

What is going on here? (image attached)

1706318--107399--quoi.png

In order for a level to be loaded, it must have been added to the build. Open build settings… edit–>build settings…

A pop up window will appear, there you will see all levels you have in your project. You must check the levels you want included in the build. If the level does not exist in the selectables, you must “add this level”.

Look at the attached picture.

lol.
this may seem ridiculous, and perhaps you’ve tried already. I’ve run into this once before and simply removing and adding again corrected the issue, also if you’ve been developing for a long while in this instance restarting unity may also help (don’t ask me why).

Otherwise, maybe try saving the scene under a new name and try again. The image doesn’t seem to display anything I’m noticing as an issue.

It says your level can not be added because it has not been added in the build settings. As I said. Look at the picture, and my response.

Yes. In the picture I have included the build settings. And the scene in question is added. And the box is checked.

Looks like it’s trying to find a level at -1 in the build settings, however, the level in your build settings is number 1.

I use a public int in my scripts and call that when using Application.LoadLevel, in the inspector I can just type the number the level is in the build settings.

Ah! You see, I was trying to load a scene from a path. I had it in a folder called Level 1 in another folder called Set 1, which was in the assets folder. Apparently Unity does not want you to use the path to the scene file, just the scene file’s name itself and it will search the entire assets folder for it.

Thank you.