How to detect is Trigger is touched on Oculus Quest with XR Input Actions

What action binding do I need to use to detect if the trigger button is being touched?

Did this help?
I use it regurally to detect if the trigger is pressed and to what extent it was(threshold float value of 0 to 1)

I think he is asking about the triggertouched state in oculus controller which is a boolean activated when the finger touches but does not presses at all the trigger, been looking for that and couldn’t find anything

turns out you can access quest controller inputs using TryGetFeatureValue like this little example

bool value;
if(UnityEngine.XR.InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(new ("TriggerTouch"), out value))
{
    hand.triggerTouch = value;
}
2 Likes

But why is triggerTouched not available in the input action editor binding menu? For all button-ish things with touch detection there is both primaryButton and primaryPressed (using primary buttons as an example), but for the trigger button there is only triggerPressed. Both the OpenXR and the Oculus documentation suggest that triggerTouched should also be available…

Following up to my previous post: triggerTouched does not appear in the menu, but it does work.

If you select triggerPressed and then use the blue T button to switch to path mode you can edit the text field and change Pressed to Touched. Everything then works as expected.

So there seems to be an omission in whatever the definition file is that populates the binding menu.

1 Like