Hey I’ve been searching up and down to try and figure out whats going wrong in this code for my GUI.Button but to no avail i still haven’t been able to figure out why the button isn’t working the problem is that when i click the button it doesn’t have any effect here is my code
public bool play;
public GUISkin theSkin;
void Start(){
play = false;
}
void OnMouseUpAsButton(){
play = true;
}
void Update(){
if (play == true) {
Application.LoadLevel(1);
}
}
void OnGUI(){
GUI.skin = theSkin;
GUI.Button (new Rect (Screen.width / 2 - 140, Screen.height / 2 - 75, 300, 100), "PLAY");
GUI.Button(new Rect(Screen.width/2-140, Screen.height/2+30, 300, 100),"QUIT");
}
}