0 votes
by (260 points)

Hi,
I am trying to just detect a single input from the controller but I can't do it.
I am using the code shown below but nothing happens.
Unity v 2019.4.38f1
Pico XR Unity SDK 2.0.4

using UnityEngine;
using UnityEngine.XR;
public class controllerInput : MonoBehaviour
{
    private bool ltriggerValue;

    // Update is called once per frame
    void Update()
    {
        if (InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).TryGetFeatureValue(CommonUsages.triggerButton, out ltriggerValue) && ltriggerValue)
        {
            Debug.Log("Trigger button is pressed");
        }
    }
}

When I open the XR Input debugger (Unity Editor-->Window-->Analysis-->XR Input Debugger) it detects the Pico Left- and Right-Hand controllers and the Pico HMD but when I press any button it doesn't register anything.

Any ideas?

1 Answer

0 votes
by (15.1k points)

Dear developer,
Could you please tell us what is the PUI version of the device? The Pico Unity XR SDK 2.0.4 requires PUI to update a corresponding runtime to work properly. So maybe the runtime has not been upgraded. You can try to restart the device after confirming the network is connected, the runtime will be updated automatically in a few minutes. You can also try to update to the latest PUI version.
In addition, do you use android Logcat and other tools to get logs?
Debug.Log("Trigger button is pressed");
Run the program on the device to see if the log is output.

...