Search Unity

Bug My button wont click

Discussion in 'UGUI & TextMesh Pro' started by jaxsmu, Dec 20, 2022.

  1. jaxsmu

    jaxsmu

    Joined:
    Dec 9, 2022
    Posts:
    37
    and half of my options have disappeared
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.SceneManagement;
    5.  
    6. public class MainMenu : MonoBehaviour
    7. {
    8.     public string firstLevel;
    9.  
    10.  
    11.       // Start is called before the first frame update
    12.     void start ()
    13.     {
    14.  
    15.     }
    16.  
    17.     // Update is called once per frame
    18.     void Update()
    19.     {
    20.        
    21.     }
    22.  
    23.     public void StartGame()
    24.     {
    25.          SceneManager.LoadScene(firstLevel);
    26.     }
    27.  
    28.     public void CloseOptions()
    29.     {
    30.         optionsScreen.SetActive(false);
    31.     }
    32.  
    33.     public void QuitGame()
    34.     {
    35.         Application.Quit();
    36.     }
    37. }
    upload_2022-12-21_6-17-8.png
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    There is no button component attatched to this
     
  3. jaxsmu

    jaxsmu

    Joined:
    Dec 9, 2022
    Posts:
    37
    bro i am soo stupid sorry
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    No worries, it happens to the best of us
     
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,473
    Also, please don't post UI questions on the 2D forum. There are dedicated UI forums here.

    I'll move your post.