GUI buttons not showing

tnx to “worldofcars” i was able get the gui buttons to work but what is wrong with my script it doesnt show the buttons when I click the button?

the script:

var shownewgame : boolean = false;
var showcontinue : boolean = false;
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();
}
shownewgame = true;
showcontinue = true;
}  

function Update(){}

function OnGUI(){
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
    }
}
}

Chances are that the click has no effect. Since the script is attached to a gameobject, chances are you need a collider and (maybe) a kinematic rigidbody on it, otherwise it won’t register clicks.

To test this, just place a

Debug.Log("accepting clicks?", gameObject);

before

audio.PlayOneShot(beep);