0
\$\begingroup\$

I am setting up my project with XR Interaction toolkit. As usual, there are two red rays from the controllers after the set up as shown below.

enter image description here

However, I want the rays to appear exactly as it is in the image below.

enter image description here

The rays will be short and when I point to an object, a pointer appears like I have in the below image. I have played around with the XR Interactor Line visual. I was able to reduce the length and width of the rays but the pointer isn't there for interacting with objects.

Another attempt I made was to add XR Interactor Reticle Visual component to my controller. I then added sphere prefab to the reticle prefab. It looked like want I want but also could not interact with buttons like the normal ray would.

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Did you remove the collider from the sphere prefab you used for the reticle? \$\endgroup\$
    – DMGregory
    Feb 20, 2023 at 13:30
  • \$\begingroup\$ Yes, I did. Actually, I was not able to add the sphere prefab to the reticle without removing it \$\endgroup\$ Feb 20, 2023 at 13:33

1 Answer 1

0
\$\begingroup\$

I figured this out too a couple of days back and just felt I should write how I did it.

If you don't already have an XR Interactor Line Visual component added to your controller, add it. I reduced the Line Width, Changed the Color Gradient to white and Invalid Color Gradient to grey, I also changed the Line Length.

For the Reticle, I created a sphere gameObject on my scene, removed the sphere collider, dragged it to my material, reduced the scale to 0.03 in all dimensions. If it doesn't work after this, change the sphere's Material to _defaultMat.

\$\endgroup\$

You must log in to answer this question.

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