UI Buttons Not Responding

I can’t get the buttons to respond in any way. The raycast target is checked and the Interactive box is checked. I used my own image rather than the default sprite provided. I deleted the text object and set the highlight and button press to desired colors. However, the buttons are completely unresponsive to hover or click. I created a UI panel and put my buttons within this. The code works fine for setting active and inactive. Even when I pull the buttons to a different canvas or create a new button they are completely unresponsive.

Does anyone know why this has happened?

I’m using Unity 2019.1.1a.

Did you try any other element like slider in its default state to check if it is working?

do you have EventManager in your scene?
And graphics raycaster in Canvas?

maybe few screenshots would help to check.

I’ve never used the event system before so I deleted it. Was this a mistake?

I tried other buttons in default state without code attached. However, I did set the highlight and press colors to see if they were working. However, they are not responsive either. I created a new canvas and then created a new button in its default state inside of that canvas. However, the results were the same. I really can’t figure out what has happened.

I can provide you with some screen shots.

4060345--353485--Img01.JPG
4060345--353488--Img02.JPG
4060345--353491--Img03.JPG 4060345--353494--Img04.JPG

[Header("UI Quit Controls")]
    [SerializeField]
    private GameObject quitGui;

private void Start()
    {
        quitGui.SetActive(false);
    }

public void ExitGame()
    {
     
        SceneManager.LoadScene(1);

    }

public void ResumeGame()
    {

        quitGui.SetActive(false);

     

    }

@Tim-Duval

With UI system, you have to have Event system in scene… otherwise, not interactivity.

https://docs.unity3d.com/Manual/EventSystem.html

If you add an UI element, it gets automatically added.

For example, add a button, “EventSystem” gameObject will be added with all needed components.

1 Like

Well this sure explains a lot! I’m going to look at your link and research into it. However, I have a quick question, if you don’t mind. I deleted my eventSystem. How can I get it to come back into my hierarchy? I never used it when designing my main menu and I have deleted it every time but the buttons still work fine. That’s why I’m confused here.

Ok and that worked like a freaking charm! I really appreciate that!

UI->>EventSystem

I found it :slight_smile:

1 Like