Showing results for 
Search instead for 
Did you mean: 

OVRInput.NearTouch not working with OVRPlugin with OpenXR backend


Make a Unity 2020+ project.

Add OpenXR Oculus provider.

Add Oculus Integration (at the time of this writing v39, but doesn't really matter. Tried it with v37 also)


Load/make a scene with a controller prefab (could be OVRControllerPrefab or CustomHand).


OVRInput.Get(OVRInput.NearTouch.Any)) will always return false.


Change to Legacy OVRPlugin and it will return true when touching with thumb or index finger.


Anybody know why?


It seems to me a bit sloppy to make a plugin that is needed for the platform specific things (passthrough, hands, etc) while advocating for the OpenXR backend but then have this feature broken.


In many VR examples you often see a thumbs up gesture being made. That is pretty much impossible with OVRPlugin using OpenXR.



Having same issue, still present using Oculus Integration v40 (released 2022-06-01). It is immersion breaking whilst using controllers with passthrough when your index fingers and thumbs don't move.


More digging shows that controllerState.NearTouches is always 0 at OVRPlugin.cs:2874


OVRP_1_16_0.ovrp_GetControllerState4(controllerMask, ref controllerState);


Have found a temporary work around. In Oculus\SampleFramework\Core\CustomHands\Scripts\Hand.cs:115 change UpdateCapTouchStates to:

        private void UpdateCapTouchStates()
            m_isPointing = !OVRInput.Get(OVRInput.NearTouch.PrimaryIndexTrigger, m_controller);
            m_isGivingThumbsUp = !OVRInput.Get(OVRInput.NearTouch.PrimaryThumbButtons, m_controller);
            m_isPointing = !OVRInput.Get(OVRInput.Touch.PrimaryIndexTrigger, m_controller);
            m_isGivingThumbsUp =
                !OVRInput.Get(OVRInput.Touch.PrimaryThumbRest, m_controller) &&
                !OVRInput.Get(OVRInput.Touch.One, m_controller) &&
                !OVRInput.Get(OVRInput.Touch.Two, m_controller) &&
                !OVRInput.Get(OVRInput.Touch.PrimaryThumbstick, m_controller);

The caveat being this detects when the index fingers and thumbs are touching (but not pressing) the capacitive sensitive parts of the controller, but not when they are nearly touching them. For my use this was good enough.

Honored Guest

I got around this by using the Legacy OVRPlugin. You can activate it in Oculus -> Tools -> OpenXR.