Search Unity

Joystick state changes aren't always reporting - breaks Hold interaction

Discussion in 'Input System' started by Deleted User, Apr 24, 2020.

  1. Deleted User

    Deleted User

    Guest

    I have set up a joystick in the new input system without any interactions (just a simple value/axis pairing on the Joystick X axis). I subscribed to the .performed callback, and I notice that the values can be misleading and/or updates aren't sent.

    For example, if you hold the joystick to the full left side, and slowly relax it, you can observe the reported values slowly returning to zero.

    However, if you quickly release the joystick by just pulling your thumb off entirely, the last reported value is -0.99 and the new 0 state isn't reported.

    I noticed that if you subscribe to the .canceled callback, it always reports zero, which is nice --

    however, the HoldInteraction source doesn't consider the .canceled phase, so this value is never reported - it will think you are still holding the joystick even if you aren't any longer.

    I haven't checked, but I'm guessing a few other interactions are probably missing this as well!
     
  2. Rene-Damm

    Rene-Damm

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    What's the joystick and platform? My guess is this is a problem with the HID fallback not setting the axes up correctly and thus data being read incorrectly.
     
  3. Deleted User

    Deleted User

    Guest

    I'm seeing this on the Oculus Quest hardware (link mode) and with the OpenXR Plugin (1.0-preview) running on both Vive, Rift, Quest, and Index.

    The axes appear to be reporting fine in the input debugger window. If I poll the values directly they seem to be reporting properly.

    I thiiink the problem is that HoldInteraction doesn't listen for "canceled" events, where the newly-released-joystick-value-of-zero IS correctly reporting as a zero value.