GUI create 2 buttons after activated when user clicks the mouse

my problem is that I want to make 2 GUI buttons apear when the player clicks on a button one saying “New Game” and the other “Continue” can some one pls help me

the code I used is :

var levelToLoad : String;
var soundhover : AudioClip;
var beep : AudioClip;
var QuitButton : boolean = false;
function OnMouseEnter(){
audio.PlayOneShot(soundhover);
}
function OnMouseUp(){
audio.PlayOneShot(beep);
yield new WaitForSeconds(0.35);
if(QuitButton){
Application.Quit();
}
else{
function OnGUI(){
	// 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.

	// make a box for group
	GUI.Box (Rect (0,0,100,100), "Game Options");
	GUI.Button (Rect (10,40,80,30), "New Game");
	GUI.Button (Rect (10,50,80,30), "Continue");

	// End the group we started above
	GUI.EndGroup ();
}
}
@script RequireComponent(AudioSource)

You can make something like this:

function OnGUI(){
   if GUI.Button (Rect (10,0,80,30), "Button that triggers two more btns");
   {
      if GUI.Button (Rect (10,40,80,30), "New Game");
      {
         // code for New Game Button
      }
      if GUI.Button (Rect (10,80,80,30), "Continue");
      {
         // code for Continue button
      }
   }
}

This invokes a button that calls two more new buttons while pressed. PLEASE adjust the Rect coordinates in THIS code so they fit your own GUI design. Hope this helps you –if not, just let know :slight_smile: Greetings from México.

alt text

I got all these errrors

var shownewgame : boolean = false;
var showcontinue : boolean = false;

function Update(){
}

function OnGUI(){
if(GUI.Button(Rect(0,0,200,30),“Show the other 2 buttons”)){
shownewgame = true;
showcontinue = true;
}

if(shownewgame == true){
    if(GUI.Button(Rect(0,40,200,30),"New Game")){
        //Code for new game button
    }
}
if(showcontinue == true){
    if(GUI.Button(Rect(0,80,200,30),"Continue")){
        //Code for continue button
    }
}

}

//This must work;) If you have any questions, let me know;)