Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Question Unable to get hand devices during hand tracking on Meta Quest2

Discussion in 'Input System' started by pushio, Dec 27, 2023.

  1. pushio


    Mar 21, 2023
    I'm trying to get a hand device using the source code below, but I can't get it.
    I would like to know how to obtain it from InputDevices due to the package I am using.

    Unity: 2021.3.32f1
    OpenXR Plugin: 1.9.1
    XR Hands: 1.3.0
    Oculus Quest 2 Runtime:

    Code (CSharp):
    1. UnityEngine.XR.InputDevice leftDevice = InputDevices.GetDeviceAtXRNode(XRNode.LeftHand);
    2. UnityEngine.XR.InputDevice rightDevice = InputDevices.GetDeviceAtXRNode(XRNode.RightHand);
    4. Debug.Log($"xrnode=left, device={}, valid={leftDevice.isValid}");
    5. Debug.Log($"xrnode=right, device={}, valid={rightDevice.isValid}");
    Code (Boo):
    1. xrnode=left, device=, valid=False
    2. xrnode=right, device=, valid=False

    I tried another method and was able to obtain the device using the following method.

    Code (CSharp):
    1. MetaAimHand leftHand = (MetaAimHand)InputSystem.GetDevice("MetaAimHand");
    2. MetaAimHand rightHand = (MetaAimHand)InputSystem.GetDevice("MetaAimHand1");
    Last edited: Dec 27, 2023