Can't click UI Buttons

Hi , why my button can’t be pressed??

Here is my screenshot:


1 Like
  • Make sure the graphic has “raycastTarget” set to True.
  • Make sure the button has its “interactable” set to True.
  • If there’s a nested canvas in the button’s parent, that canvas also needs GraphicsRaycaster.

If all those are fine, then start the game, select your EventSystem and click your button. At the bottom of the inspector you’ll see what your click hit (in that dark box that is visible in the first screenshot). It might be something else capturing the click before the buttons.

120 Likes

I added GraphicsRaycaster to the parent and it fixed my problem! Thanks so much!

17 Likes

Thank you!!Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! I spent the last three hours looking for the reason why my buttons weren’t working. I knew something had to be blocking them but couldn’t figure what. You are the first and only person that I have found that game me an actionable way (besides going through every object in my scene) to figure out what was the problem. YAY!!!:smile:

4 Likes

EventSystem?

15 Likes

An event system should be automatically added to your scene when you add a canvas. If you need one for something else (and have no canvas), you can add it yourself. You can also add it yourself if you accidentally deleted it :slight_smile:

29 Likes

Awesome! Thanks, man.

1 Like

If your still having problems after doing the above I found that my problem was that in the buttons ‘On Click ()’ settings. I had set for the button to change the sprite in an image component although I had left the sprite reference equal to none. Make sure you guys haven’t left out any references in the ‘On Click()’ settings.
This is what the problem was:
3762136--313843--Capture.PNG

Id just like to say be sure you have things “ordered” correctly in your manager. It looks like your buttons may be behind your panel.

4 Likes

In my case I forgot that I had a canvasgroup component on the button’s parent. The “Interactable” and “Blocks Raycasts” options have to be ticked to allow the interaction with the child buttons.

3 Likes

here is my screenshots. I still can not click on UI button!



Aw damn. Seems like I did just that. Finally I know why nothing’s working. Did a bit too much cleanup in my project files :roll_eyes:

2 Likes

I didn’t have an events system in my scene, putting one in solved my problem.

9 Likes

Hi, I can click on my button when I use it on windows (game view) but is not detecting my gestures when I run in the hololens. I want to reproduce an animation for a UI. everything works fine besides the clicking.

How did you solve the problem I’m having the same issues

Thank You :slight_smile:

1 Like

Yup, sorry to revive this old thread again !

But if you still can’t click on your button even with all the solutions above, make sure your GameObject with the button component has an Image component ! It can happens if your “Target graphic” is not the same GameObject, so you only put the Button component and no image … You still need an image … Set its opacity to 0.

I just got this problem, and could not figure out what caused it … For the last 10 minutues or so :slight_smile:
Hope it help

2 Likes

Thanks. i deleted that one.

2 Likes

HOLY CRAP thank you so much for this post oh soo long ago

I had the enable raycast targets on all the panels and check off both interactable and Blocks raycasts on the canvas grouping and then finally the button was firing. WOW. That took too long to figure out and finally after typing “button wont enable click unity” into google did this thread pop up.

I hope no one ever has to lose that time again.

Mine Fixed when I put back the EventSystem, because I deleted it. So don’t delete EventSystem.

1 Like