Files
2026-11-01 23:39:55 +02:00

1.8 KiB

Raycast Receiver

The Raycast Receiver is a non-visual Graphic component that intercepts raycasts from the Graphic Raycaster. It allows you to define an area on a Canvas that blocks or detects pointer events-such as clicks, touches, or hovers-without rendering any visible geometry.

This component is ideal for creating invisible interaction zones or blocking input from reaching underlying objects. Unlike an Image component with its alpha set to zero, the Graphic Raycaster does not generate mesh data, making it a more performant solution for invisible hit-testing.

Properties

Property: Function:
Raycast Target Enable Raycast Target if you want Unity to consider the image a target for raycasting.
Raycast Padding Space added to the RectTransform for raycasting.

Raycast Receiver inherits from the Graphic class, visual properties such as Color and Material remain exposed in the API. However, these properties have no effect on the component, as the Raycast Receiver does not generate any renderable geometry.