Search Unity

Where are the resources for learning the Oculus Go Controller?

Discussion in 'VR' started by vinnie7899, Feb 4, 2019.

  1. vinnie7899

    vinnie7899

    Joined:
    Apr 29, 2016
    Posts:
    2
    I'm trying to learn about integrating the Go controller into my Unity apps and not getting too far. There seems to be a universal lack of info about this. The Oculus dev site has topics about OVRInput and other general info but nothing that starts you off from square one and leads you through the process. I've only found one scene in the Oculus Utilities package that even uses the controller ("GearVrControllerTest") and it's very limited. The Unity docs also have limited info. I haven't had much luck finding any good books or videos, either. Do you have any suggestions or recommendations?
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    If you've found OVRInput, then you've found all you need. You literally call OVRInput.Get to get the status of the trigger or touchpad, and OVRInput.GetLocalControllerRotation/GetLocalControllerPositionto get the controller's local position and rotation. That's it. (The Oculus sample code makes things a lot more complicated, but for no good reason.)

    Consider joining the GOmmunity Discord server. Lots of Go devs (and players) hang out there, and are always happy to help in real-time.
     
  3. vinnie7899

    vinnie7899

    Joined:
    Apr 29, 2016
    Posts:
    2
    Thanks JoeStrout--I'm looking for a little more information than that, hopefully in a step-by-step format. Or, I'd settle for some good example scripts that show most it not all of the kinds of things you can do with the controller.
     
  4. jskubick

    jskubick

    Joined:
    Oct 7, 2018
    Posts:
    11
    Besides importing the Oculus package from the asset store, is there anything special you have to do to enable the Go's controller to be read? I'm trying to enhance a game I originally wrote for Android Cardboard to take advantage of the Go's controller.

    After making some minor changes to get the project to build and run on the Go (importing the Unity package from the Asset store, adding Oculus and deleting Cardboard as Virtual Reality SDKs in Player Settings -> XR, and changing the build method from Gradle to Internal), it seemed to automagically recognize the controller's trigger as gamepad button 1... but OVRInput.IsControllerConnected inevitably returns false for all arguments besides "OVRInput.Controller.None"

    RTrackedRemote, LTrackedRemote, Active, All, Gamepad, LTouch, RTouch, Remote, Touch, and Touchpad all cause it to return false.

    I'm starting to suspect that it might be necessary to add one of the Oculus prefabs to the scene, but I'm not sure. Oculus' developer documentation is pretty awful... just about everything Go-specific feels like a tacked-on afterthought.
     
    foq1978 likes this.
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hmm, I don't think it should be necessary to add anything else to the scene. But there is one script from all that Oculus stuff that I do use, and that's OVRManager. Just throw that on some object in your scene, and see if that helps.
     
  6. foq1978

    foq1978

    Joined:
    Aug 5, 2009
    Posts:
    41
  7. jskubick

    jskubick

    Joined:
    Oct 7, 2018
    Posts:
    11
    I haven't had time to experimentally verify the precise behavior, but it looks like it's a power management issue. My guess is that the Go allows the controller to go to sleep, doesn't wake it up until the game launches/resumes, and the controller doesn't actually become officially connected until some time later.

    After I moved the call to IsControllerConnected() into Update, I noticed that it eventually started returning 'true'... and as far as I can tell, it will almost always return 'false' when called from Awake() or Start().
     
    JoeStrout likes this.