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...
Romain Posted February 13 Share Posted February 13 Hello, Just a little update to say that the sample code doesn't seem to work with the latest version of the WaveXRPlugin, however the asset shared by @thylaxene (https://assetstore.unity.com/packages/tools/integration/pa-proximity-25685) still works perfectly. Also I found this post by looking for a replacement for CommonUsages.UserPresence since it's not supported anymore since the release 5.3.0 of Wave XR Plugin and I wondered why it's no longer supported ? Was it replaced by something else I didn't found ? Thanks, Link to comment Share on other sites More sharing options...
VIVE_chengnay Posted Sunday at 02:21 AM Share Posted Sunday at 02:21 AM Hi @Romain, Recently, I just tested the sample code provided by BabelSW. It is still working. May I know your project setup? Unity version, plugin version... etc. 1 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