Search Unity

Simply detecting the HTC Vive presence

Discussion in 'AR/VR (XR) Discussion' started by NocSchecter, Mar 28, 2019.

  1. NocSchecter

    NocSchecter

    Joined:
    Aug 19, 2015
    Posts:
    33
    I am using the following code but it does not work in the statement that checks if the hmd is disconnected

    Code (CSharp):
    1.      public bool isVREnable;
    2.      private void Update()
    3.      {
    4.          if (XRDevice.isPresent)
    5.          {
    6.              isVREnable = true;
    7.              Debug.Log("Vive is connected");
    8.  
    9.          }
    10.          else
    11.          {
    12.              isVREnable = false;
    13.              Debug.Log("Vive is not connected");
    14.          }
    15.      }