0
\$\begingroup\$

I have about ten UIs with buttons in my scene. I can cast my XR Ray on all of these UIs and the buttons work fine except two. The buttons on these two UIs are clickable but the rays are not showing on them. I don't know why

enter image description here

\$\endgroup\$
5
  • \$\begingroup\$ I see a warning about missing an event camera. Is that shown on all your working button canvases too? \$\endgroup\$
    – DMGregory
    Mar 6, 2023 at 11:43
  • \$\begingroup\$ Yes, this exact setting is on all the canvases \$\endgroup\$ Mar 6, 2023 at 13:22
  • 1
    \$\begingroup\$ Are you able to reproduce this in a new scene — either making the scene from scratch, or saving a copy of the current scene and deleting everything except one misbehaving button and the raycaster to interact with it? That'll help you narrow down a Minimal Complete Verifiable Example so you can describe how readers can reproduce this issue locally. Once readers can reproduce it, they can test potential fixes to be sure they'll work for you. \$\endgroup\$
    – DMGregory
    Mar 6, 2023 at 13:46
  • 1
    \$\begingroup\$ I appreciate your concern. It's a big project with a lot of scenes. This particular scene has a lot in it. In fact, it was built by someone else. I'll find a way to reproduce it in a new scene \$\endgroup\$ Mar 6, 2023 at 14:14
  • \$\begingroup\$ If you've solved the problem, post an Answer below with instructions for how a reader can apply your solution to their own project. \$\endgroup\$
    – DMGregory
    Mar 7, 2023 at 15:30

1 Answer 1

0
\$\begingroup\$

I managed to solve this by adding an XR Simple Interactable component and a box collider to these two canvases. One thing is that if the collider protrudes out too much, the xr-ray will not be able to interact with the items on the canvas, the end point of the ray will be front of the collider. So, I made the canvas as tight as possible and it worked as expected.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .