Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
JamieSinn's avatar
JamieSinn
Honored Guest
13 years ago

Oculus Detection?

Is there a way in the Unity SDK to detect if there is an oculus attached?
I want to make it optional for use of the oculus, and I haven't seen a way to detect if it is connected so far.
Thanks :D

4 Replies

Replies have been turned off for this discussion
  • I just use something like this:-

    if(OVRDevice.SensorCount > 0) {
    riftFound = true;
    }
  • You can use the OVRMessenger, like it is done in the OVRMainMenu:
    OVRMessenger.AddListener<Device, bool>("Sensor_Attached", UpdateDeviceDetectionMsgCallback);


    So you add a callback function that will get called when a device is either attached or detached.
  • I asked the same question a while ago Krispers answer is what I came up with.

    viewtopic.php?f=37&t=1648

    I check this on startup to auto switch the games mode but you might want to provided a confirmation option which I eventually plan to do.
  • "sh0v0r" wrote:
    I asked the same question a while ago Krispers answer is what I came up with.

    viewtopic.php?f=37&t=1648

    I check this on startup to auto switch the games mode but you might want to provided a confirmation option which I eventually plan to do.


    Sorry, it was from your original post that I copied the code. Couldn't remember where it came from :oops: