Okay I am trying to make a GUI pop up after completing a set number of laps but I’m getting all these errors with the coding that I have put in saying to put something in instead of what I have and when I do what it is asking it just brings up even more errors. My code is in Javascript, I have a lot of things commented out because they worked and I wanted to keep them in so if I fail at adding this pop up I can have my original coding. If at all possible when explaining what I did wrong could you make it as thorough and simple as possible because I am extremely new to programming and can barely understand it Thank you very much for your help.
function OnTriggerEnter(other : Collider){
if (score <= 2){
score = score + 1;
print(score);
}
else
{
function OnGUI()
{
//(Application.LoadLevel("Tutorial Level"));
// Make a group on the center of the screen
GUI.BeginGroup (Rect (Screen.width / 2 - 50, Screen.height / 2 - 50, 100, 100));
// All rectangles are now adjusted to the group. (0,0) is the topleft corner of the group.
// We'll make a box so you can see where the group is on-screen.
GUI.Box (Rect (0,0,100,100), "Do you want to continue with the Tutorial or move on to the real tracks?");
if (GUI.Button (Rect (10,40,80,30), "Yes"))
{
Application.LoadLevel("Tutorial Level");
}
if (GUI.Button (Rect (30,60,100,50), "No"))
{
Application.LoadLevel("Title GUI");
}
// End the group we started above.
GUI.EndGroup ();
}
}