Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Other UI Buttons become unclickable the second time they're shown (no issue on Unity 2020.3.0f1)

Discussion in 'Editor & General Support' started by Hyperion90, Sep 22, 2022.

  1. Hyperion90


    Dec 12, 2014
    I'm encountering a weird issue after upgrading to Unity 2021.3.6f1. I was previously using Unity 2020.3.0f1 and just switched to the newer version a few minutes ago.

    On the previous Unity version, the following issue never appears. However, on Unity 2021.3.6f1, there's some strange thing going on.

    A few of my game's menus are meant to only be shown after clicking a certain button. In order to do that, I place them all inside a GameObject, and enable/disable the respective menu depending on the case. Here's a screenshot of my hierarchy:

    Every menu you can see in the screenshot contains a Title (UI Text Component), a GameObject which contains a few buttons (UI Buttons) and a ScrollView:

    Now the weird thing is that the first time I open up the menu, everything works just fine. However, the second time I do that, clicking the buttons inside my menu simply doesn't work. The EventSystem also doesn't detect any click inside the menu in the screenshot above. Here's a preview:

    Initially, I thought that the second time my menus open up, an overlapping UI element would cover the screen, thus not letting me click elements inside. However, I have manually checked each GameObject in my scene to validate, and nothing looks wrong. Also, it works flawlessly on Unity 2020.3.0f1 on another computer.

    Another thing that I've noticed is that after my menus become unclickable, I can fix the issue by adding a Graphic Raycaster to the parent of my menu. As a result, a hacky workaround would be to add a graphic raycaster to my menu's parent GameObject every time I open it up. Here's what I'm talking about:

    This looks more like a Unity bug. Has anybody else encountered this?