Dear community,
I am trying to make a simple main menu, but for some reason my buttons do not work, before I even get the chance to click the button already executes itself and switches to the next level as it is supposed to do.
using UnityEngine;
using System.Collections;
public class Main_menu : MonoBehaviour {
public Texture2D buttonImage1 = null;
public Texture2D buttonImage2 = null;
private void OnGUI()
{
if (GUI.Button(new Rect (500, 400, buttonImage1.width, buttonImage1.height), buttonImage1));
{
Application.LoadLevel(1);
}
if (GUI.Button(new Rect (500, 500, buttonImage2.width, buttonImage2.height), buttonImage2));
{
Application.Quit();
}
}
}
can anyone have a look and see what might be the issue, because I have no idea why it’s doing what it’s doing.