Search Unity

Testing Oculus Go within Unity Editor

Discussion in 'AR/VR (XR) Discussion' started by DipDip2k, Jun 6, 2018.

  1. DipDip2k

    DipDip2k

    Joined:
    May 14, 2018
    Posts:
    1
    I am testing the waters with VR and doing a few experimental things to help get use to working with VR. I have the Oculus Go and everything is working fine, however to test my demo I always have to create an .APK build and deploy it using ADB install etc.

    I've seen many people on YouTube testing inside the Unity Editor by hitting the Play Button. This does not work for me, is there a specific set up to do this? It would really help and save me some time.

    Cheers.
     
    sivrikaya and ThomasMeddens like this.
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    What specifically isn't working for you in editor? In general the biggest disconnect is input and some people roll their own emulation or some use my product that has keyboard/mouse emulation of the HMD and Go controller to speed up testing times.

    Generally though, input and sometimes the more involved camera setups should be the only thing that doesn't work out of the box.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Hmm, for me (as with the original poster) it doesn't work at all out of the box — I get an error along the lines of "Unable to load OVR DLL".

    So, what I've done in my projects is made a little script that disables certain game objects (and enables others) when UNITY_EDITOR is true. I use that to disable the OVR stuff. I also added a script that moves the camera around from mouse input, emulating head turning, and enable an object under the main camera that serves the job of the Go controller (that is, it has a script on it that updates the reticle, just like the script on the left and right Go controllers which are disabled when running in the editor).

    It's a bit of a pain in the neck to set up, but once done, it works fine.
     
  4. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Which version of the utilities and which components throw errors in editor? I've tried quite a few combinations of things over the years but obviously not all (I think they are on their 26th release currently). Currently for go development I encounter no issues in error besides needing to emulate the controller.

    I'm sure it would be nice to keep a list, my projects tend to only use OVRManager so perhaps that's why I don't encounter errors in editor? From the camera side in my projects I find Unity's native camera set to both eyes is sufficient so perhaps it's one of the scripts related to that?
     
  5. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Can you provide a link to one of those video?
     
  6. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    I get that same error. I'm on a mac and I don't think the Oculus utilities work on a mac. They may work on Window.s
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Perhaps that's it; I'm also on a Mac. My setup is very simple (a single camera) too; but if I have anything that accesses the OVR plugin at all, it fails in the editor.
     
  8. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Ah didn't realize you guys were on a Mac and that is indeed why you see that error in the editor.

    https://forums.oculusvr.com/developer/discussion/58002/development-on-macos-high-sierra

    The native side of the runtime doesn't exist on OSX hence the error. It does exist on the android side which is why it's fine on device.
     
    ThomasMeddens likes this.
  9. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yikes, that's a disturbing thread. Hopefully Oculus manages to resolve its rectocranial inversion soon.
     
  10. kenlem1

    kenlem1

    Joined:
    Mar 20, 2014
    Posts:
    40
    Yes, sounds like Oculus isn't keeping up with Mac. No matter. I'll code around it.

    I wish Unity had the ability to hit run and test right away in the headset. The only device that can do that is the Windows Mixed Reality headsets, as far as I've seen. Would be nice to have it on other devices but I don't expect it soon.
     
  11. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Vive, Rift, WMR and probably all other PC headsets work right after you click play plus they also support Unity Editor VR. OP probably watched such videos(?) or used one of those frameworks that mirror mobile events to PC and screen to VR with a much lower fps and quality.
     
    YingLLL likes this.
  12. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    I've tried Vive and Rift with Unity and, correct me if I'm wrong, you have to push it to the device to run it. WMR just runs on the device when you hit run. Can anyone tell me for certain because maybe I've been doing it wrong all this time.
     
  13. Ostwind

    Ostwind

    Joined:
    Mar 22, 2011
    Posts:
    2,804
    Push it to where? there is no special storage in PC headsets. All you need to do is to add Oculus or OpenVR as the first item to XR settings and hitting play in the editor will work. SteamVR or Oculus Home will automatically start if they are not running when hitting play.
     
  14. kenlem

    kenlem

    Joined:
    Oct 16, 2008
    Posts:
    1,630
    Sorry. Not sure what I was thinking. I've been doing a lot of oculus go work lately and the only way to test there is build and deploy to the device. I was confused.
     
  15. Boegi

    Boegi

    Joined:
    Dec 6, 2014
    Posts:
    19
    Hello, is there any news about this topic? I'm very annoyed of building and adb testing with my oculus go ;-)
    Maybe we can share some "workarounds"? Thanks anyway... and have a nice weekend.
     
  16. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I just test within the editor most of the time (I have test code that uses mouse/keyboard to control the camera/controllers when UNITY_EDITOR is true). When I need to build and run, well yeah, that's a bit of a pain — but I only do it a couple times per day.
     
    Boegi likes this.
  17. Boegi

    Boegi

    Joined:
    Dec 6, 2014
    Posts:
    19
    Joe - Thanks for your reply. I'm doing this the same way. However... It's not the same like using it directly ;-)

    Has anyone tested the Unity Remote App on the Go? As far as I remember there was also a "workaround" to get the two cameras? (Quick search... Something like this...
    )

    Thanks for your replies...
     
  18. tesasdlkjaslkd

    tesasdlkjaslkd

    Joined:
    Dec 20, 2017
    Posts:
    1
  19. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,980
    From here: https://forums.oculusvr.com/developer/discussion/68489/unity-and-oculus-go-preview-in-editor

    "Hi.
    To have a preview, I use when I am on editor the GVR SDK for Unity and when I build and run I disable the "OVRCameraRig" and enable.
    You just need to downoald this : https://github.com/googlevr/gvr-unity-sdk/releases/tag/v1.170.0.
    You need to create an empty gameobject "GVR".
    Add to this Gameobject a camera and the prefab "GVREditorEmulator"
    And you can preview in editor. You just need to active "GVR" and desactive the "OVRCameraRig" when you are in preview and the opposite when you build/run."


    Sounds like a good way to get decent emulation working!