How to hide ray visual when not pointing at UI elements

Hi Everyone,

Just started using XRI and have dropped in the prefab for xr origin and I have controllers and hands.

  1. How do I only show the rays when pointing at a UI panel its annoying having the ray visuals always on.

I’m guessing there is a tickbox somewhere in one of the attached scripts but not seeing anything that would give this behaviour.

Many thanks!

Hey @IWDEV22
The latest XRI Starter Assets sample has an example of how to shrink the ray down to a small line when not interacting or hovering something that is interactable. You could use this as a starting point to customize the visual effect you are looking for.

Hey this thread popped up as the #1 search while I was trying to figure out the same question. I figured I’d answer it to save someone some trouble.

As of 2025, the Demo scene in the 3.1.1 starter assets doesn’t seem to address this question, but it’s simple enough to figure out.

If you’re using the XR Rig with the Near-Far interactors, browse down to the “LineVisual” object (Which is a child of the Near-Far Interactor). In the Curve Visual Controller, there is an expandible section called “No Valid Hit Properties”. Gorgeous. To hide the line on no valid hit, simply adjust the “Start Width and End Width” to 0. Happy coding!

For those who want to get rid off the pointer droplet. Right / Left Hand → Pinch point stabilization → Turn the ‘Hide object when interactor blocked’ script off