# Stock Unity VR: Oculus detection

**URL:** https://discussions.unity.com/t/stock-unity-vr-oculus-detection/653653
**Category:** XR
**Tags:** XR
**Created:** [January 29, 2017, 10:41am UTC](https://discussions.unity.com/t/stock-unity-vr-oculus-detection/653653 "2017-01-29T10:41:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![plmx](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/plmx/32/986629_2.png) [@plmx](https://discussions.unity.com/u/plmx)
#### Post date: [January 29, 2017, 10:41am UTC](https://discussions.unity.com/t/stock-unity-vr-oculus-detection/653653/1 "2017-01-29T10:41:16Z")

</div>

Still trying to support both Vive and Rift with plain Unity. Now, the Oculus Touch buttons map differently to the Joystick names (as shown here: [Unity - Manual: XR architecture](https://docs.unity3d.com/Manual/OpenVRControllers.html)). Some button IDs (e.g. 0) map to different buttons, e.g. Menu on the Vive and One (“A”) on the Rift. This means I have to KNOW if a Rift or a Vive is installed so I can map the keys to the correct in-game actions.

However, I can’t seem to figure out how to get that info when running OpenVR. If I run with the Oculus runtime only (no OpenVR), I get “Oculus” as a result from VRSettings.loadedDeviceName, and “Touch” from “UnityEngine.Input.GetJoystickNames()”. However, that is not the case when running SteamVR, which also supports the Rift. I always get “OpenVR” back, no matter if the Rift or the Vive is installed.

What is the suggested way of getting this information?

---

<div class="post-metadata">

### Author: ![Hazneliel](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/hazneliel/32/371331_2.png) [@Hazneliel](https://discussions.unity.com/u/Hazneliel)
#### Post date: [February 11, 2017, 4:43am UTC](https://discussions.unity.com/t/stock-unity-vr-oculus-detection/653653/2 "2017-02-11T04:43:18Z")

</div>

This is a common problem and one which Im looking for an official answer from Unity. For the time being I use:

```csharp
if (VRDevice.model.ToLower().Contains("oculus")) {

```

---

<div class="post-metadata">

### Author: ![plmx](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/plmx/32/986629_2.png) [@plmx](https://discussions.unity.com/u/plmx)
#### Post date: [February 12, 2017, 9:35pm UTC](https://discussions.unity.com/t/stock-unity-vr-oculus-detection/653653/3 "2017-02-12T21:35:32Z")

</div>

I must have missed that particular string. Thanks!
