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)

Hi,

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:
https://docs.unity3d.com/ScriptReference/XR.CommonUsages.html

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:
https://docs.unity3d.com/ScriptReference/XR.CommonUsages-primary2DAxis.html

By the way,here are the correspondence XR API parameters for Pico Neo 3 controller buttons you could refer to:
https://sdk.picovr.com/docs/UnityXRSDK/en/chapter_five.html#introduction-to-pico-neo-3-input

Hope this information helps you.

...