Search Unity

Bug Broken IUnityXRInput interface in unity-xr-sdk-v1-main

Discussion in 'Input System' started by nfynt-zap, Oct 26, 2022.

  1. nfynt-zap

    nfynt-zap

    Joined:
    Jun 3, 2021
    Posts:
    20
    Following my disappointment from: https://forum.unity.com/posts/8511251/

    I started playing around with InputProviderSample provided inside of unity-xr-sdk-v1-main which uses Unity's legacy input system. I was easily able to add new buttons and axes inputs using legacy input, and test it across android and windows build. I found a rather annoying descripancy in input axes mapping between XR-SDK and Unity Input system.

    As per the XR-SDK,

    Code (CSharp):
    1. /// A 1D axis that maps to an index-actuated trigger.  This must always be within the range of [0,1] where 0 is open and 1 is fully squeezed.  This maps to input axis 8 if the device's role is kUnityXRInputDeviceRoleLeftHanded, and axis 9 if the role is kUnityXRInputDeviceRoleRightHanded.  If this is implemented, the device must also implement kUnityXRInputFeatureUsageTriggerButton.
    2. UnityXRInputFeatureUsage const kUnityXRInputFeatureUsageTrigger = "Trigger";
    where the trigger action binding <XRController>{LeftHand}/trigger or <XRController>{RightHand}/trigger is not trigger with new Input System. This rather seems to be mapped to axes 9 (for left controller) and 10 (for right controller) with older input system!!!

    Subsequently for Grip axes binding

    Code (CSharp):
    1. /// A 1D axis that maps to a hand squeeze activated grip.  This must always be within the range of [0,1] where 0 is open and 1 is fully squeezed.  This maps to input axis 10 if the device's role is kUnityXRInputDeviceRoleLeftHanded, and axis 11 if the role is kUnityXRInputDeviceRoleRightHanded. If this is implemented, the device must also implement kUnityXRInputFeatureUsageGripButton.
    2. UnityXRInputFeatureUsage const kUnityXRInputFeatureUsageGrip = "Grip";
    it seems to be binded with Axes 11 and 12!! Which is also only accessible using older Input system.

    I wonder if this axes mismatch is the reason for trigger or grip axis action not being fired up on the new Input System. Please find further unity version and input package details in the footer.

    Would appreciate your prompt response.

    Software setup details:
    Unity version: 2021.3.11f1 and 2021.3.2f1
    New Input package version: 1.3.0 & 1.4.3
    Platform: Standalone (Window) and Android

    Below you can see input dump of when right controller trigger and grip button were in the pressed state. The Right controller state reported Trigger value as 0, where as older input system reported value as 0.98 for Axis 10.

    upload_2022-10-26_16-51-30.png