Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Creating games for VR and non-VR users alike

Discussion in 'AR/VR (XR) Discussion' started by ryanmillerca, Jan 8, 2019.

  1. ryanmillerca


    Aug 12, 2012
    Hey gang. I'm working on a project that targets Oculus, Vive (through OpenVR), as well as keyboard & mouse/gamepad folks who have no headset. I'm using Unity 2018.3 and the built in XR 'virtual reality supported' features.

    Building a project that switches between these camera and control schemes seems straightforward enough; but Unity seems to run into some errors on machines that don't have any VR software/drivers.

    I get these warnings/error in Editor (on a mac with no VR)

    Warning:  Virtual Reality SDK Oculus failed to initialize. Will attempt to enable OpenVR instead.
    Error: XR: OpenVR Error! OpenVR failed initialization with error code VRInitError_Init_PathRegistryNotFound: "Installation path could not be located (110)"!
    Warning: Virtual Reality SDK OpenVR failed to initialize.
    Will attempt to enable None instead.

    and I get this error in the Player log from a built version (again, on the same no-VR computer)

    Plugins: Couldn't open /Users/redacted/, error: dlopen(/Users/redacted/Builds/, 2): Library not loaded: @rpath/LibOVRRT_0.framework/Versions/5/LibOVRRT_0
    Referenced from: /Users/redacted/Builds/
    Reason: image not found

    I'm grateful this isn't a show stopper error and that the app still executes normally, but I'd like to skip loading the VR bundles/plugins and not look for path/drivers if none are detected.

    Any tips for getting Unity to more gracefully skip VR if no hardware is detected? I'd like to avoid making separate builds for each setup.

  2. JoeStrout


    Jan 14, 2011
    I appreciate that you're including Mac users! :D I get the above warnings whenever I test my Oculus Go app within Unity (also on a Mac), but I just ignore them. But that's only testing — I can see why for shipping, you might want to eliminate them entirely.

    Unfortunately I don't know how to do that... I'm only responding to cheer you on!
    ryanmillerca likes this.