Jump to content

[Unity3D] Get Proximity Sensor Status


Recommended Posts

  • 4 months later...
  • 2 years later...

Sample code:

        public static bool IsUserPresence()
            if (ProximitySensor.current != null)
                if (!ProximitySensor.current.IsActuated())

                return ProximitySensor.current.distance.ReadValue() < 1; // near p-sensor < 1cm
                return false;
            return true;

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...