Fangh Posted September 5, 2019 Share Posted September 5, 2019 Hello everyone. For any headset, with Unity, it's possible to use XRDevice.userPresence to get the status of the proximity sensor. How can I have access to the proximity sensor with my Vive Focus ? I did not find any clue in the SDK Docs. Thank you. @Tony PH Lin @Cotta Link to comment Share on other sites More sharing options...
Tony PH Lin Posted September 6, 2019 Share Posted September 6, 2019 Hello @Fangh, Since Android has existing common APIs to access status from proximity sensor, we don't pack these kind of APIs inside of the Wave SDK. This means you can use API provided by Android SDK to retrieve the all sensor status. Let us know if you need more assistance. Thanks. Link to comment Share on other sites More sharing options...
thylaxene Posted January 18, 2020 Share Posted January 18, 2020 For anyone else needing this I used this free plugin to get a hook: https://assetstore.unity.com/packages/tools/integration/pa-proximity-25685 Cheers. Link to comment Share on other sites More sharing options...
BabelSW Posted July 1, 2022 Share Posted July 1, 2022 Sample code: public static bool IsUserPresence() { #if UNITY_ANDROID if (ProximitySensor.current != null) { if (!ProximitySensor.current.IsActuated()) InputSystem.EnableDevice(ProximitySensor.current); return ProximitySensor.current.distance.ReadValue() < 1; // near p-sensor < 1cm } else { return false; } #else return true; #endif } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now