Forum Discussion
masta-yoda
6 years agoProtege
Distinguish Oculus Quest from Oculus Go device in runtime
I have an Oculus Quest game written in Unity 3d with is playable with both controllers. It can be played on Oculus Go with the only controller but the game mechanics need to be changed so I need to know in runtime if that an Oculus Quest or Oculus Go device.
I'm currently using the following approach which is reported by Oculus Go users doesn't always work:
```
if (OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote) || OVRInput.IsControllerConnected(OVRInput.Controller.RTrackedRemote))
// Oculus Go Logic
else
// Oculus Quest logic
```
I've also used the XRSettings device name property (Quest/Go) but it seems to be deprecated.
What is the best way to distinguish the Oculus device in a Unity + Oculus SDK game?
I'm currently using the following approach which is reported by Oculus Go users doesn't always work:
```
if (OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote) || OVRInput.IsControllerConnected(OVRInput.Controller.RTrackedRemote))
// Oculus Go Logic
else
// Oculus Quest logic
```
I've also used the XRSettings device name property (Quest/Go) but it seems to be deprecated.
What is the best way to distinguish the Oculus device in a Unity + Oculus SDK game?
2 Replies
- technoticProtege@masta-yoda I haven't done this myself, but a little digging and I came across:
OVRPlugin.GetSystemHeadsetType()
which returns the headset name. came across it in this thread: https://forum.unity.com/threads/detect-what-headset-is-connected-gear-vr-or-oculus-go.536146/
scroll down a bit and you'll see the posts discussing it. If you haven't already, I highly recommend joining our Start Discord. my Discord is technotic#4370. Lots of good knowledge and help available there.
Kinda curious, if the mechanics are that different, why not maintain each as separate project? assets and scenes should be easy to keep synced so you really only have independent ux and mechanics. you would also conserve size and memory at runtime, which is especially precious on the Quest. Just an idea. It may not be a very noticable difference for your current project, but if the project grows, it could become an issue. optimize optimize optimize! ? - masta-yodaProtegeI'm just curious why the documented approach to detect which device is connected on Oculus Go doesn't work as expected and doesn't return true when the left-handed controller is paired on Oculus Go :
OVRInput.IsControllerConnected(OVRInput.Controller.LTrackedRemote)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 4 years ago
- 5 years ago