Having an issue with my Main Menu.

Hey guys, I’m having a problem with my Main Menu. The Main Menu buttons are situated on planes. Here is a screenshot.[28997-unity+2014-07-10+13-31-17-85.jpg|28997]

While in the editor, both the Play and Exit buttons load up the next scene. When I build and run it, it acts as if both buttons are exit scripts. In my most recent build, it crashed on the play button.

The Colliders for both planes:
[28998-unity+2014-07-10+13-34-38-00.jpg|28998]

As you can see, they intersect but it shouldn’t make one button do what the other does…

Sorry it’s a long post btw :stuck_out_tongue:

My Script:

Play:

#pragma strict

function Update () {
    if(Input.GetMouseButton(0))
        Application.LoadLevel("Map2");
    }

Quit:

#pragma strict
    
    function Update () {
        if(Input.GetMouseButton(0))
            Application.Quit();
        }

You’re doing it wrong, the way you have it, any time you press the Mouse button 0 it will trigger both Loading Scene and App Quit, you need to catch and even ONLY when the button is pressed, not in the update! use instead:

void OnMouseUpAsButton()
{
Application.LoadLeve(“LevelName”);
}

and delete the Update code you have, add some Box colliders to the buttons (That will be the Area of Effect of the button) do not use the Quad Collider, use Box instead and stretch it at the desired size of the button. Create one script for each button and add it to them.