0 votes
by (890 points)
recategorized by

How do I get the Pico Neo 3 controller input value?

1 Answer

0 votes
by (55.5k points)


Here is an example code to get the value of trigger button of left controller.

InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).TryGetFeatureValue(CommonUsages.triggerButton, out isDone)

You may refer to this document:

by (890 points)

Thank you~
How do I get the joystick value?
front,back, left , right

by (55.5k points)

You can try to get the Vector2 to describe the position of the left controller joystick by the following code:

        Vector2 position;
        InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).TryGetFeatureValue(CommonUsages.primary2DAxis, out position);
        Debug.Log(position.x+" : "+ position.y);//position.x and position.y is a value between -1 and 1

Here is a more specific description about primary2DAxis from Unity Documentation you could refer to:

By the way,here are the correspondence XR API parameters for Pico Neo 3 controller buttons you could refer to:

Hope this information helps you.