Search Unity

XRSettings and XRDevice properties returning null on rift and wmr

Discussion in 'AR/VR (XR) Discussion' started by RobRood, Dec 10, 2018.

  1. RobRood

    RobRood

    Joined:
    Sep 25, 2016
    Posts:
    5
    Tried on 2018.2.13f and on 2018.2.18f and getting the same result.

    XRSettings.enabled returns false regardless if Virtual Reality Supported has been checked in XR Settings
    XRsettings.supportedDevices has been returning a empty string array
    XRDevice.model have been returning a empty string
    XRDevice.isPresent has been returning false event with a functioning VR hmd actually playing VR from the editor

    Sample Code:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.XR;

    public class DetectHeadset : MonoBehaviour {

    void Start () {
    print (XRSettings.enabled);
    print (XRSettings.supportedDevices);
    print (XRDevice.isPresent);
    print (XRDevice.model);
    }

    }


    anyone else running into this problem or familiar why this wouldn't be working as e?
     
  2. rhysp

    rhysp

    Joined:
    Jun 14, 2016
    Posts:
    7
    Assuming you are using OpenVR (or any other SDK), make sure this is assigned to the first entry in Project Settings > Player > XR Settings > Virtual Reality SDKs. If this first entry is set to None, the device details will be empty at runtime.
     

    Attached Files:

  3. RobRood

    RobRood

    Joined:
    Sep 25, 2016
    Posts:
    5

    Thanks for the response. I for got about this thread. The problem resolved its self after upgrading the project to 2018.3