Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

How do you detect if you have a Vive or Vive Pro in Unity.

Discussion in 'AR/VR (XR) Discussion' started by phileday, May 22, 2018.

  1. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    124
    Hi

    Previously I've been using:

    if (((UnityEngine.XR.XRDevice.model).LastIndexOf('Vive')) == -1) {
    // It's a Mixed reality headset
    } else {
    // It's a Vive headset
    }

    I've just had someone who has a Vive Pro get in touch and say that it wasn't detecting as a Vive but a MR headset. What should I do to detect a Vive pro as well?

    Any help with this would be very welcome.

    All the best

    Phil
     
  2. TeemuMV

    TeemuMV

    Joined:
    Nov 10, 2017
    Posts:
    19
    Code (CSharp):
    1. Debug.Log(UnityEngine.XR.XRDevice.model);
    --> VIVE_Pro MV
     
  3. phileday

    phileday

    Joined:
    Feb 8, 2014
    Posts:
    124
    Brilliant :) thanks. I'll update my player now.