Search Unity

Bug Disable control should cancel the action

Discussion in 'Input System' started by BinaryEclipse, May 27, 2021.

  1. BinaryEclipse

    BinaryEclipse

    Joined:
    Sep 1, 2016
    Posts:
    43
    I have some controls that can get disabled before cancel is called. In the past, I got around this issue by creating a new object instead of enabling, but that, of course, it not optimal. I thought by now, this would have been fixed, but it clearly has not. I'm testing on the 1.1.0-pre.5 version.
    The strange thing is that the changelog suggests that this was fixed a long time ago as seen below

    [0.2.0-preview] - 2019-02-12

    Actions:
    ...
    - When an action is disabled, it will now cancel all ongoing interactions, if any (i.e. you will see InputAction.cancelled being called).
     
  2. BinaryEclipse

    BinaryEclipse

    Joined:
    Sep 1, 2016
    Posts:
    43
    To be clear, the issue is that my gameplay very often will cause a control to be disabled while a key is being held down (before the 'cancelled' event is called). Because of this, the next time I use the control (after enabling it, of course), its 'started' event will not work, because the control believes the key to already be pressed down. Only the second attempt after enabling will work. I got desperate and tested polling, but the same thing happened.
     
  3. BinaryEclipse

    BinaryEclipse

    Joined:
    Sep 1, 2016
    Posts:
    43
    are we allowed bumping?
    *bump*
     
  4. We're (if the thread is falling behind to the second page), but in case of bugs you're better off if you actually report them through the bug reporter tool inside the editor.