Raycast target on UI elements

What is the purpose of the “Raycast Target” flag on many UI elements, like images and text, and how does this impact on overall performance?

Quite simply, if selected (check box is checked), the UI element will block the raycast (i.e. your mouse click). If you don’t have it checked, then your mouse will not work on that button, and the next thing below/behind it will catch the raycast.

The point is to remove the mouse-clickability from UI elements (like maybe a name tag) that don’t need to be clickable (raycast target=false).

Likewise, if you have a UI element covering half the screen (like a window or something), you probably don’t want to click things behind it so (raycast target=true)

No performance impact either way.

Having to turn off this default on checkbox every time you add new UI elements is just annoying busywork - it’d be great if this was fixed engine side.

It’s worth to mention that if element has Raycast Target property disabled but ANY of its child element has it enabled, the parent will still get IPointerClickHandler event!