Question by
AWtheoriginal · Aug 30, 2015 at 09:16 PM ·
sceneswitching
Why Wont my Scene Switch?
I am making a game with a start menu but every time I click the play button it says it couldn't find my scene. I already put it in the build settings. Here are some scripts I have already tried:
function OnMouseDown () { Application.LoadLevel("Levelk35tjh"); }
also this one:
function OnMouseDown () {
Application.LoadLevel("Level1");
}
and these
function OnMouseDown () {
Application.LoadLevel("k35tjh");
}
,
function OnMouseDown () {
Application.LoadLevel("1");
}
Please help, thanks in advanced
Comment
Answer by Callendor · Aug 30, 2015 at 09:49 PM
I have the scene number as a variable (just the number corresponding to the loaded scene in the build settings), this works fine:
using UnityEngine; using System.Collections;
public class LoadOnClick : MonoBehaviour {
public void LoadScene(int level){
Application.LoadLevel (level);
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612002022im_/https://answers.unity.com/themes/thub/images/avi.jpg)