Search code examples
androidunity-game-enginevirtual-realityoculusoculusquest

Detect Oculus Quest 1 & 2 Headsets in Unity


I'm looking for a way to detect the name of the headset being used in my VR app. I need to distinguish between the Quest 1 & 2 in order to implement the different controller mappings. Methods like XRDevice.model or OVRPlugin.productName don't provide any name lists in the documentation and since the quest 2 is a new model I haven't found information on it anywhere. Any help would be appreciated.


Solution

  • If you are running on the Quest 2 directly (as opposed to Oculus Link) you can use

    OVRPlugin.SystemHeadset headset = OVRPlugin.GetSystemHeadsetType();
    if(headset==OVRPlugin.SystemHeadset.Oculus_Quest){
    // Quest 1 stuff here
    }else if (headset==(OVRPlugin.SystemHeadset.Oculus_Quest+1)){
    // Quest 2 stuff here
    }
    

    They haven't added Oculus Quest 2 to the SystemHeadset enum yet, but it has a "Placeholder_9" in its place. I just prefer the "+1" for clarity.

    If you are using the link, it will return Oculus_Link_Quest for Quest 1 and I assume (Oculus_Link_Quest+1) for Quest 2. But I haven't confirmed that.

    Edit: As of 2020-12-06, both Quest1 and Quest2 return "Oculus_Link_Quest" if you're using Oculus Link.