I'm having trouble using the new action based input system in Unity OpenXR.
With the old (device based) input system it was possible to retrieve an input device object from outside the XR Rig using the InputDevices.GetDeviceAtXRNode(<node>)
function.
For example: This is what I would do in the old system to retrieve position data of the right hand controller:
InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(CommonUsages.devicePosition, out Vector3 position);
InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(CommonUsages.deviceRotation, out Quaternion rotation);
Unfortunatly I can't find a way to do the same thing with the new action based input system. All the documentation that I could find on this topic refers to the old way of doing it. It appears that this method does not work anymore.
So, is there a way to retrieve an input device from outside the XR Rig using the new action based input system?
In case it helps: My Unity version is 2020.3.4f1
and I'm using the OpenXR plugin version 1.0.3
.
Any help is greatly appreciated.
By calling this method you get all
ActionBasedControllers
returned as an array. The controller can be identified by their name.The trigger value can be read by following command: