I created an UI button but click does not work.

Another fun one for anyone going through a check list of problems:
Check if you have a canvas element (even non-image ones) overlapping the button, blocking it. Move the button lower than anything that could block it (i.e. toward the bottom) in the hierarchy to make sure it’s “on top”.

To add to this for people who have issues reading this. Ensure your hierarchy is correct and the button isnt being overlayed by another UI component. The order is top most at the bottom in the hierarchy inspector.

The issue for me was not having an “Event Camera” assigned on my “Canvas” component.

Hey guys, I created a button prefab but it dosn’t work. I checked all posibilities out there and nothing didn’t work for me. Hovewer, I noticed that when I created a new button that worked fine. (even all the values of the components was the same). As a solution I just removed the old one and created another, and now it work fine. So, try it also if the solutions above didn’t solve your issue.

Just struggled with a similar problem where portions of my buttons were not clickable. Turns out I had some other UI objects with rects that overlapped the buttons. All I had to do was find those objects, and uncheck Raycast Target on them. Everything worked perfectly after that.
In all the posts that I searched, nobody suggested this as a possible reason, but I expect its the main cause for unclickable button issues.

For me, it was an accidental click on the Interactable checkbox. Make sure it’s check off in the Button (Script) component of a Button.

I had the same issue. After several enjoyable hours of changing every setting under the sun, I stumbled across this line of code in a script that I copied from a GUI Animator sample:

GUIAnimSystemFREE.Instance.SetGraphicRaycasterEnable(Canvas, false);

Removing fixed this fixed all of my button woes. And my headache and bad mood!

I had a symilar problem a way of solving if none of the other things worked is check that u have “block raycast” activates in your canvas group component in the canvas ur button is on

Check than you have “EventSystem” in your scene else add it ;),Don’t remove “EventSystem” from your scene or add it :wink:

My issue was just that I needed to put the UI items, that were in front, lower in the hierarchy.

open the EventSystem then play the game,
it will works.

My solution was slightly different to all the other solutions above - for me, I had no overlayed / obfuscating elements, my button was interactable and the canvas had a Graphic Raycaster and was assigned to the correct camera, but I needed to change the “Target Eye” option on my camera to “None (Main Display)”. This meant that it worked with the Standalone Input Module for me!

I had this problem for sooooo long and none of the other fixes worked for me.

My fix: In the Console, uncheck “Error Pause”.

Then play your scene again.

For me there was missing Standalone Input Module on object with Event System.
My own components that responded to Input.touch was working fine but none of the standard UI components worked.

A last reason would be that you are using a Canvas Group in your Canvas, and that “Blocks Raycasts” is disabled.

In new projects unity 2021.3.11f make sure to add default input modules (button in event system component)

I somehow added a Canvas component to my Button.
Removing that allowed the button to be clicked again.