Laser pointer style UI interaction in VR
I'm trying to implement the laser pointer style interaction for world space UI in VR. Similarly to how it's done in the experimental Unity VR editor or Tilt Brush:
Basically I need to replace the mouse with an arbitrary world space raycast from the motion controller.
I've seen two different approaches so far, both of which had some issues.
An older tutorial from Oculus uses a custom GraphicRaycast and InputModule to implement gaze aka. look-at controls. This approach can't really be adapted to motion controllers. You can only interact with UI that is on the screen. With motion controllers it is possible that neither the UI nor the controller are visible and interaction should still work.
The VR Samples project uses Physics.Raycasts and colliders instead. I think this should work with motion controllers as well, since you just need to change the raycast parameters. But this project doesn't seem to use actual UI at all. It's just simple meshes instead of world space canvases.
I would really like to figure out how to implement a world space UI canvas with laser pointer style interaction. Is it not possible at all to do arbitrary world space raycasts into a canvas?
Thanks!
Same here. I don't want to juggle Oculus vs Cardboard vs Vive etc API and systems. I have a transform that points at something whether that's my eye camera or hand-held controller, and it should just work.
Answer by uyar · Jun 05, 2017 at 02:13 AM
i will try to add eyegazer to the controler, and test the sampel scenes, i will post the results if i dont forget.
Answer by conigliocattivo · Sep 01, 2017 at 08:24 AM
did you find a good solution for this problem? I have the same issue and my actual solution is to use a Physics Raycasts such as the one of the Unity VR Samples and simply attach colliders to every UI Canvas element. It works but I was just wondering if there is a better solution.
Thanks, Antonio
Your answer
Follow this Question
Related Questions
SteamVR and canvas interaction? 2 Answers
OnPointerEnter blocked by something 2 Answers
SteamVR Laser OnPointerClick not work with UI Element 0 Answers