Cause and mechanism
Graphic Raycaster finds uGUI elements under a click or tap. Images and text that do not need input can add unnecessary candidates. Check Raycast Target flags, Raycasters on each Canvas, the input module, and Blocking settings that let other objects obstruct UI hits.
Check and correct the setup
- Disable Raycast Target on decorative graphics while retaining a suitable hit target for each control.
Inspect input targets in front - Remove raycasters from noninteractive canvases and check input filters/masks.
Inspect input targets in front - Canvas splitting mainly limits rebuild scope; it does not automatically reduce raycast candidates.
Inspect input targets in front
Limits and verification
Disabling all targets also disables interaction. Test clicks, touch, scrolling, and dragging while measuring CPU time.
A focused diagnostic setup
Use one canvas with an interactive button and decorative graphics. Separate disabling decorative Raycast Targets from removing the canvas raycaster.
Test in this order
- Profile input raycasting separately from layout/graphic rebuilding.
Inspect input targets in front - Disable decorative targets incrementally while retaining the button’s intended hit graphic and checking transparent foreground panels.
Inspect input targets in front - Test pointer, touch, scrolling and dragging while comparing candidate work and CPU time.
Inspect input targets in front
Interpret the result
Removing a raycaster can remove required interaction. Inspect CanvasGroup blocking, button interactability and foreground occlusion separately.
Related explanations
- UI buttons do not respond: check the EventSystem and transparent raycast blockers
- Reduce uGUI canvas rebuild and layout cost
- Profiler