0 votes
by (460 points)

hi developer,

trigger button is not working when I click on the game object enabled collider.

bool triggerL, triggerR;

public UnityEngine.UI.Text debugText;

void Update()
{
    InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(CommonUsages.triggerButton, out triggerR);
    InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).TryGetFeatureValue(CommonUsages.triggerButton, out triggerL);

    if (triggerL)
    {
        debugText.text = "triggerL";
    }
    else if (triggerR)
    {
        debugText.text = "triggerR";
    }
    else
    {
        debugText.text = "no_press";
    }
}

I'm using the above code, it is not returning, after updating PUI v4.6.13. I made factory reset once i got issue with keyboard is not opening when I click on the inputfield.

I used the Sdk version: Pico UnityXR SDK_v2.0.4
unity 2019.4.38fl

1 Answer

0 votes
by (970 points)

I had this issue before, would you click the picoXR in Edit->project setting->XR plug-in Management->Android Setting. Try again and have a test.

by (460 points)

Hi dood, I have done the following steps, still the trigger is not working. I have updated the sdk version to 2.0.5 there trigger is working fine. Do you have any idea to set tracking reference. In XR rig, tracking origin mode has the option to set tracking reference, but in XR origin tracking origin mode does not have the option to set tracking reference. It helps the app, not to get updated with position and rotation of the head when scene transition. Here the enum is not available, do you have any idea to set tracking reference in XR origin?

ago by (970 points)

Hi, here is what i did:

    public Text leftText,rightText;
    bool triggerRight, triggerLeft;

void Update()
    {
        InputDevices.GetDeviceAtXRNode(XRNode.LeftHand).TryGetFeatureValue(CommonUsages.triggerButton, out triggerLeft);
        InputDevices.GetDeviceAtXRNode(XRNode.RightHand).TryGetFeatureValue(CommonUsages.triggerButton, out triggerRight);
        if (triggerLeft)
            leftText.text += "left pressed";
        if (triggerRight)
            rightText.text += "right pressed";
    }

notice:make sure android picoXR is clicked like I said before. And what all i did is when i press the trigger, text will show which hand presses.

...