Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

XR Input issues when reactivating controller after swapping

Discussion in 'VR' started by immerxive001, Dec 31, 2019.

  1. immerxive001

    immerxive001

    Joined:
    Jun 28, 2016
    Posts:
    1
    Using Unity 2019.3.0b4 with an HTC Vive system (first generation controllers)

    We found the following issue:

    We read button inputs / axis using

    Code (CSharp):
    1. device.TryGetFeatureValue(UnityEngine.XR.CommonUsages.triggerButton, out triggerValue)
    Where device is assigned on device connection via XR event

    Code (CSharp):
    1. nputDevices.deviceConnected += OnDeviceConnected;
    2.  
    3. private void OnDeviceConnected(InputDevice dev)
    4. {
    5.     device = dev;
    6. }

    Steps to reproduce the issue:

    Turn on both controllers (everything is fine),
    Turn off right controller (we receive the deviceDisconnected event for it and left is still working),
    Swap the controllers (right controller on the left hand and viceversa),
    Turn on the (now left) controller again, but it doesn't work anymore, not getting values from inputs (while the now right controller is still working)

    On the last step we receive the deviceConnected event for a new right controller that makes the new right controller still working but we don't receive and updated InputDevice for the new left controller. We would expect an additional deviceConnected event for the left also, or at least a deviceConfigChanged event that would make us update the left device structure correctly.

    Does anyone know anything about this issue? Same issue happens using VRTK library. SteamVR seems to be not affected by, but we would prefer to use XR.

    We also created a bug report

    http://fogbugz.unity3d.com/default.asp?1208467_35aupe60qkoo379i