When i start the game everything works but when the player dies , and when i hit the menu button and then start the game the GUI buttons are still there and my player is disabled and the game isn’t reset and when i hit for second time the menu button and again go to main menu and hit for second time Play game then the GUI is removed and everything is good.Here is my code
function OnGUI () > { > if (playerIsDead == true) > { > if (GUI.Button(Rect(Screen.width*0.5-50, > 240, 100, 40), "Respawn")) > { > RespawnPlayer(); > } > if (GUI.Button(Rect(Screen.width*0.5-50, > 240-40, 100, 40), "Menu")) > { > playerIsDead = false; > Application.LoadLevel("MainMenu"); > } > } > }