I recently had another problem with a missing button on my menu, but thankfully that has been solved. My new problem is that when I play my game from the main menu, it automatically starts the game. This is the code I have made for the main menu:
function OnGUI() {
GUI.Box(Rect(Screen.width /2 - 120,Screen.height /2 - 70,250,220), "Main Menu");
if(GUI.Button(Rect(Screen.width /2 - 120,Screen.height /2 - 50,250,50), "Start Game"));
Application.LoadLevel(1);
if(GUI.Button(Rect(Screen.width /2 - 120,Screen.height /2 + 0,250,50), "Options"));
GUI.Box(Rect(100,500,250,20), "Graphics coming soon");
if(GUI.Button(Rect(Screen.width /2 - 120,Screen.height /2 + 50,250,50), "Credits"));
GUI.Box(Rect(100,550,550,20), "Game developed by Andromeda (Myles and Will)");
if(GUI.Button(Rect(Screen.width /2 - 120,Screen.height /2 + 100,250,50), "Quit Game"));
Application.Quit();
//IGNORE THIS GUI.Box(Rect(100,550,1040,20), "Main menu v2 has been temp. removed due to glitches. Old menu is a temp fix. Only Start and Quit work.");
}
Please ignore the IGNORE THIS, that’s for when I revert back to my old menu. Anyway, it automatically starts the game! How do I stop this and make it so it starts the game when the Start Game button is clicked?
EDIT: Also, I tried the toggle buttons so when you click it, some more information pops up (for the Options and Credits buttons), but I can’t seem to get that to work. If possible, could you help me with getting toggle buttons? Thanks!