Search Unity

Oculus Go controller not interacting with Unity Canvas

Discussion in 'AR/VR (XR) Discussion' started by daveinpublic, Feb 14, 2019.

  1. daveinpublic

    daveinpublic

    Joined:
    May 24, 2013
    Posts:
    167
    I'm trying to use an Oculus Go controller to interact with a Unity canvas, and no matter I do I can't get it to work. I've tried searching on Forums and Google and done everything they've said, read through Oculus' developer blog to see what to do. I added the line renderer to see where it's pointing, made sure it's on the right physics layer, have the latest Oculus Utilities.... Every time I think I get somewhere, there's something else that stops me. I've been trying everything I can, is there a way I can video chat with someone, or anything? This is the most difficult thing, I have no idea why it would be this difficult to do something so basic? Please let me know as soon as possible :)

    Thanks,
    David
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Well, it's not really that simple. Unity's event system is built around 2D screens; it's really not well designed for 3D pointers and 3D canvases.

    It can be done, of course. I don't always use Oculus's scripts to do it, but when I do, here's how:

    1. Put the OVR Input Module on your EventSystem (disabling or removing any other input module).
    2. Add an empty object to your scene, and put the poorly-named OVRGazePointer script on it. Point its RayTransform property at your controller object (the thing you expect to use to point at the UI).
    3. Put the OVRRaycaster script on your Canvas, removing the GraphicRaycaster it had before.

    I think that should do it. Give it a try, and report how it goes...
     
  3. Ziggy73701

    Ziggy73701

    Joined:
    Jul 23, 2018
    Posts:
    11
    Hi Joe, thanks for bouncing me over from the other thread.
    This covers Oculus which uses its own SDK..
    am trying to do this with SteamVR to be generic as possible.. OpenVR I guess.
    Am just starting out, and.. for me things that should be complicated.. actually seem easy. I have a monitor stand, with a thumbnail detailing a movie that if a user click.. the script is there and it plays on that canvas. The script to play the movie on the canvas was.. pretty well documented.
    The mechanic to make that canvas “clickable” using a VR controller seems... well it may as well be in Latin!
     
    anattress likes this.