UI Button is Clickable Everywhere On Screen


Hi I have some UI buttons (The Blue Question Mark Squares). However I am having an issue in that the buttons are clickable anywhere on screen for some reason. This means that I can’t actually click any button accept the ones at the bottom of the hierarchy.

I thought this might be because I am scaling the button, but it appears that the problem still occurs even with a 1,1,1 scale.

The world space camera has the correct camera set.

If anyone could give me some ideas of how else to troubleshoot this I’d very much appreciate it.

Check if there is any image above your buttons in the hierarchy with Raycast Target enabled. Those will catch clicks too

  1. There is Raycast Padding option on the Image component that can affect this.
  2. Are sure that this is the bottom of the hierarchy? Children can affect the clickable area.

For example, I use such a technique to expand the clickable area of the button via empty TextMesh Pro object in my AR Masker:

Thanks. There are no images above it in the hierarchy

Thanks. I did check that all the raycast padding has been set to zero. Could be the text below it in the hierarchy. There is also a line renderer graphic and some empties. I’m pretty sure that the text at least is set to be the same size as the button, but I’m not sure I have set it not to be a raycast target. I will check when I get back to my PC this evening

Yeah, it turns out I had a custom UI Line Renderer component that I had neglected to uncheck “is raycast target for.” Idk why the line renderer causes the whole screen to become clickable, but it doesn’t really matter b/c that line renderer was never really intended to by a raycast target for anything.

Thank you! I had the same problem and this was the solution for me.

A child of the button object was taking up the whole screen and unchecking “Raycast Target” on this child fixed it from catching any clicks.