0 votes
by (150 points)

Via CommonUsages.primary2DAxisClick, I can access joystick click input. However, CommonUsages.primary2DAxis doesn't seem to return joystick 2d input.

1 Answer

0 votes
by (7.7k points)
selected by
 
Best answer

hi,
The value of CommonUsages.Primary2DAxis is available.
The SDK I use is Unity XR SDK V2.0.3.

You can try the following code:

 private Vector2 moveVector2;
    void Update()
        {
        if (InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(CommonUsages.primary2DAxis,out moveVector2))    
                {
                    Debug.Log("CommonUsages.primary2DAxis:" + "x:"+moveVector2.x+"y:"+moveVector2.y);
                }
    }
by (150 points)

Thank you for the response!
It turned out that joystick 2d input was blocked by a joystick touch check since pico neo 3 controller doesn't provide touch state.

...