Graphic Raycaster

When a Canvas is added to the scene, it is automatically given a Graphic Raycaster component.

This is the raycasting system that will allow you to interact with all UI objects that are children of that Canvas. It has three properties: Ignore Reversed Graphics, Blocking Objects and Blocking Mask.

The Reversed Graphics toggle determines whether or not graphical objects within the Canvas can be interacted with if they are facing backward (in relation to the raycaster). The Blocking Objects and Blocking Mask allow you to assign the types of objects that are in front of the Canvas (between the camera and the Canvas) that can block raycasting to the Canvas.

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.