Quick answer: Cosmetic UI Image: RaycastTarget = false. World camera: add Physics2DRaycaster. Buttons keep RaycastTarget true.
Full-screen HUD with score panel. Click on a world enemy. Nothing happens. The HUD background, with RaycastTarget on, swallowed the click.
The Fix
HUD background Image:
Raycast Target: false // don't block
HUD button:
Raycast Target: true // still clickable
World camera:
+ Physics 2D Raycaster
Event Mask: Default
Enemy GameObject:
+ EventTrigger or IPointerClickHandler script
Cosmetic graphics shouldn’t block. Buttons opt in. Physics2DRaycaster routes pointer events to colliders.
Verifying
Click HUD button: triggers. Click world enemy through HUD background: enemy reacts. Click HUD label area: passes through.
“Cosmetic off. Interactive on. World rays through.”
Related Issues
For Canvas Scaler mobile, see Canvas Scaler. For TMP InputField caret, see TMP caret.
Cosmetic off. Buttons on.