Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

releasing a button not registering with the new input system

Discussion in 'Input System' started by kris8360, Aug 10, 2020.

  1. kris8360

    kris8360

    Joined:
    Jan 11, 2013
    Posts:
    34
    Hi again, if I put a hold interaction on a button, and hold it more than the defined hold time, I can't use that button again.

    This is how it goes:
    context.started triggered when pressing the button - ok

    if I just tap the button, or hold less than the hold time:
    context.cancelled triggers on button release - ok

    if I hold the button for the defined hold time:
    context.performed triggered - ok
    but context.canceled never triggers when I release the button - not ok

    And i never can use that button again after that.

    What do I do wrong?
    This is my code, I only log the context changes, even removed all my game logic, this is just the button event.

    upload_2020-8-10_15-37-51.png

    upload_2020-8-10_15-41-41.png

    I'm using Unity 2019.4.5f and Input System 1.0.0 from the package manager.
     
    galbenaim8 likes this.
  2. kris8360

    kris8360

    Joined:
    Jan 11, 2013
    Posts:
    34
    This is the output log:
    As you can see after holding and releasing, pressing the button again, nothing happens.
    upload_2020-8-10_15-53-9.png
     
  3. kris8360

    kris8360

    Joined:
    Jan 11, 2013
    Posts:
    34
    Ok, I detected what the problem was:
    upload_2020-8-10_16-42-19.png
    I had both a gamped button and a keyboard (space) binded to the same action (Jump).
    This caused a problem for some reason, removing the gamepad button solves this issue. (JumpHold)

    I think it must be a bug tho, because you cannot use a controller button for some reason.
    Tried with: PS4 X button, Xbox Controller A button, and Button South gampad, all the same result.
     
  4. kris8360

    kris8360

    Joined:
    Jan 11, 2013
    Posts:
    34
    I set action type: pass through, control type: button, and it's working with controllers too.
    So I guess my issue is solved.