You can use the usual android sensor enumeration to access the proximity sensor - the range is from 0 to 8... 8 being far proximity and 0 being close. TMG399X
However, I believe this seems to be just the sensor on the Galaxy Note 4 and not the proximity sensor on the Gear VR device?
Did anyone have any luck getting access to the proximity sensor or any other way to detect if the device is put on or not.
So far I've tried several different solution to this problem, neither OnApplicationFocus or OnApplicationPaused works in this case.
Another solution i tried was to see if the application paused in some way that isn't detected, but it just seems as the applications keeps running in the background as if nothing changed.
I also just tried to access the proximity sensor on the phone, this only resulted in it reading as always being far away.
For now as a very bad temporary work around I'm going to try to just use movement data from the OVR to detect if it has been put taken off, hopefully i can read this as if the Samsung Gear VR was moving to quick or jerky to be on the head.
So far only the built in OnApplicationPause() function in Unity (which is supposed to work in the same way and works fine in other applications)
But it seems as the applications keeps running even when not wearing the headset, so I don't think that would work anyway. As stated as before I think it only makes the screen color turn to black, not turning it off or anything else.
Unfortunately there is no API that is exposed to us for fine grain control. This is Samsung level code that we can't access through the mobile SDK. If you're trying to change the distance at which the sensor is active there isn't a good way to do this.
If you're trying to determine whether the headset is on the user's face or not, you can try using - ovr_HeadsetIsMounted()
Ah I see, that should work then I guess 😄 I'll look around and see if I can get it running in Unity then, since its not yet implemented. If something hasn't changed since this post viewtopic.php?t=23927