Hi, I’m just starting out with Unity and I’m trying to create a reset button for a racing game that I’m making.
Here the code I have for the button.
if(GUI.Button(Rect(btnX, btnY * 40, btnW, btnH), “Reset”)){
Application.LoadLevel(Application.loadedLevel);
}
At the start, the player should have a choice of 5 different cars, and I tried to put the code for the buttons inside the Reset button code, but when I pressed it in game, the scene would load, and the five buttons would show up for a split second before disappearing. All that is left would be just the background. Does anybody know why that is?