Problem with click detection on a panel

Hi
I’m working on a Unity project for Android that features an interactive world map. Upon selecting a country, a panel with additional details overlays the map. I’m running into an issue with click events.

Problem: When I click on the overlay panel, the underlying country is unintentionally selected, indicating that the click is being captured by the country’s collider before reaching the panel.

Attempts:

  • I’ve experimented with various solutions, including adjusting the hierarchy, experimenting with different collider types, and modifying click detection scripts.

Goal:

  • I aim to ensure that clicks on the overlay panel take precedence over any underlying elements.
  • The panel should be the sole recipient of clicks when it overlaps other UI elements.

  • “I’m trying to create a non-interactive overlay panel that doesn’t trigger events when clicked.”
  • “I need to prevent the panel from capturing click events that should be ignored.”

I’ve already tried adjusting the hierarchy, colliders, Event System, click detection scripts, Canvas Group, and Graphic Raycaster, but I haven’t found a solution.

I’m at a loss for what to try next. Any suggestions or insights would be greatly appreciated.

did your canvas group, which presumably should capture all events, had “Block Raycasts” ticked?

if I understand correctly, you don’t want child objects to receive ui events before their parents. if this is true, this is the opposite of how Unity’s UI is built.

if you actually mean that after seeing the popup the clicks go through, then simply add an invisible image as the popups background, that’d block everything (there are 10s of ways of doing this, this is just one).
of course, if this popup is added on another canvas entirely, make sure that canvas has the right sorting order (I believe higher sorting means “closer to the screen”).
if it’s under the same canvas, then the popup should be in a section below the initial UI in the hierarchy (which should happen automatically if you’re correctly seeing your popup on top of the initial UI).
otherwise, see if you’re using any UI assets/UI systems that are non-standard and mess up with your sorting. this should be a very simple use-case, try to avoid any complex solutions as it’s likely the issue hides in plain sight