Skip to main content
New Participant
October 23, 2013

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
    This topic has been closed for replies.

    4 replies

    Up and Coming
    October 24, 2013
    I just use something like this:-

    if(OVRDevice.SensorCount > 0) {
    riftFound = true;
    }
    Up and Coming
    October 24, 2013
    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.
    sh0v0r
    Up and Coming
    October 26, 2013
    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.
    Up and Coming
    October 28, 2013
    "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: