- Home /
Levels in Unity
This is a very noob question but how do you save different levels off in Unity. I was creating a gui but couldn't understand where it was calling to and where it gets specified within unity. For instance within the code bit below, where would the 1 be pointing two? Am I suppose to specify this somewhere within Unity or is this calling out to external files? Mostly I just want to know where the 1 points to in this code bit so that I know how to utilize it within the gui.
if (GUI.Button (Rect (70,40,80,20), "Start")){
Application.LoadLevel (1);
}
Answer by BiG · Oct 13, 2011 at 06:35 AM
I'm not sure to understand your question well...Are you wondering about the origin of that "1" in "Application.LoadLevel (1);"?
In that case, you are calling the loading of a level by its index. And, to do so, you have to go in File->Build Settings to "load" your level into the project build and assign an index to it.
You can also call the loading of a level by its name:
Application.LoadLevel ("Level_1");
, as an example.
Sorry for the poor wording and thanks that actually helped a lot. I mostly didn't understand where to start when placing the index. I understood how to call just didn't know how to assign it to those index values. Thanks a bunch.
Your answer
![](https://koobas.hobune.stream/wayback/20220613005600im_/https://answers.unity.com/themes/thub/images/avi.jpg)