Level 'level1' (-1) couldn't be loaded.
In your case, you can't load the level which you want and get this silly errors. When I was a beginner level programmer in Unity I've faced this problem and get a big hassle. I searched all the internet what is the solution of Level 'levelToLoad' (-1) couldn't be loaded in Unity'. But, Unfortunately I can't get any clear solution for this problem, this is why I just solve the problem and give the tutorial.
Why Problem happens:
In Unity, Unity build the level which you create. But sometimes, if you create multiple level and sometimes Unity can't catch the level and can't build it automatically. This is why Unity can't get the level which you passed in Application.LoadLevel("level_name");Solution Of Unity Level Loading Problem:
In my case, My problem was I've created two scene. One is level1 and other is menuScene. After making a button in menuscene I wanted to load the level - level1. But I can't do that.
That means in button click I've made that code:
public void Play(){string level = "level1";Application.LoadLevel (level);}
I think, you see that In build settings, I've one Scene named manuScene. And that is why I've got the error. Then, I first select the level1 Scene and Click on Add Current button in Build settings. See the button below the box.
Then, my Build settings in File > Build Settings will be like this:
And then, my problem has gone and my button worked successfully.
Hopefully, I've cleared your problem of Level 'level'(-1) could not be loaded problems in Unity.
If you face any problem, just comment here, I'll help you.
0 comments:
Post a Comment