Allow UI element to capture ray

I’m using a setup where I use raycasts to select objects and then have UI popups for modifiers. The problem however is that the rays travel through the UI. Is there a method to absorb these rays? Do I need to do an event check to verify my mouse is not over a UI object or is there a way for the UI elements to block the ray collisions?

You can add “Canvas Group” component to your UI canvas and set Block raycast to “false” temporarily so that UI wont respond to the raycast. But if this is not feasible, then maybe you can use layerMask to avoid raycasting the UI layer

Also in “Graphic Raycaster” component, you can try checking blocking objects to all. Depends on your scenario