Search Unity

Gyro and accelerometer not working in Oculus Go?

Discussion in 'AR/VR (XR) Discussion' started by Gnimmel, May 22, 2018.

  1. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    I have a game on the Gear VR call Jogger, which has a running on the spot mechanic to move forward using the VR Step plugin.

    I just revived a couple of 1 star reviews because it's not working on the Oculus Go.

    I spent the weekend looking at this problem and I can't get any data from the gyro or the accelerometer on the Go, while the same code on a Gear VR works fine.

    For example, simply creating a TextMesh and adding some simple code to print the acceleration just returns 0 0 0.


    Code (CSharp):
    1.     public TextMesh TMesh;
    2.  
    3.     // Update is called once per frame
    4.     void Update ()
    5.     {
    6.         TMesh.text = (Input.acceleration.ToString());
    7.  
    8.     }
    Is this a Unity bug or has someone else managed to read the accerometer ?
     
  2. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hey, another VR Step user here. I'll be keen to hear any results! Thx
     
  3. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Not too familiar with VR Step but if it was using the Unity Input class, on Gear VR that returns the phone's information not the headset (both had motion sensors on gear vr). On Oculus Go there is obviously no phone just the headset's motion sensor which you access via the Oculus API.
     
  4. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    VR Step uses "Input.gyro.userAcceleration" which works great on GearVR.

    I thought as Oculus was built into Unity it would use the same inputs as before, but I guess not.\
    Do you have any hints on where to find the Go SDK docs? I can't find anything on the built in gyro.
     
  5. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    It was the galaxy phone part of gear vr that responded to that call, it wasn't using the headsets gyro. The Go doesn't have a phone and doesn't implement all of the normal android stuff.

    You could try using UnityEngine.XR.InputTracking and query the nodestate for the HMD's acceleration. It may work but on the mobile side some of those calls have been iffy unlike on PC. Doesn't hurt to try.

    Otherwise, you'll have to download the Oculus Utilities and use OVRManager.display.acceleration
     
    JoeStrout likes this.
  6. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    Thanks for the reply, but unfortunately even with Oculus Utilities I still can't get a value from the accelerometer other than 0,0,0.

    I've emailed Oculus support and hopefully they can help.