Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Detecting Oculus when starting the app with no VR

Discussion in 'AR/VR (XR) Discussion' started by xipeluife, May 8, 2017.

  1. xipeluife

    xipeluife

    Joined:
    Jan 15, 2013
    Posts:
    14
    I'm developing a standalone application that starts in non-VR mode (with the VR Device set to "None") and later, the user chooses if they would like to experience the game in VR mode or not, loading the preferred device by using VRSettings.LoadDeviceByName method.

    What I would like to do is to know if there is a VR device connected (Oculus in this case) before making the user choose the mode they want, so that if there's no device, simply go with non VR mode without prompting the user to choose an option.

    I've been trying through the VRDevice.isPresent method, but it always returns false when starting in non-vr mode.

    Any help would be greatly appreciated.
     
  2. greggtwep16

    greggtwep16

    Joined:
    Aug 17, 2012
    Posts:
    1,546
    Each of the native sdks has ways of either getting a connected device count or checking if something is connected. That being said, when not in VR I don't think Unity bothers to check them. You could fill out a bug report, or if your in a jam use each of the native calls respectively.