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

How to setup Release Only interaction?

Discussion in 'Input System' started by UPlayOnline, Jun 12, 2020.

  1. UPlayOnline

    UPlayOnline

    Joined:
    Oct 31, 2014
    Posts:
    8
    I'm trying to use Hold and a single button press for two different actions on UI, using a gamepad.

    For the UI navigation I'm using the EventSystem module, so I need to setup actions to call "performed" event, because I can't change the code for the EventSystem.

    To diferentiate hold from press I need to setup the button press binding with "release only" interaction.

    The problem is that the press action is only calling the "performed" event once.

    The hold interaction is working fine.

    Am I missing something?
     

    Attached Files:

  2. UPlayOnline

    UPlayOnline

    Joined:
    Oct 31, 2014
    Posts:
    8
    Ok, I've discovered that setting the binding to Submit or PrimaryAction makes the interaction Press with "Release only" only work with mouse, but it does not work with the gamepad button. If I remove all that bindings and set a single one with Button South it works fine.

    Also the UI Submit (using the InputSystemUIInputModule) is not working if Press "Release Only" is set, but works with "Press only" or "Press and release".
     
    Last edited: Jun 12, 2020
  3. holycowproductions

    holycowproductions

    Joined:
    Jun 8, 2016
    Posts:
    6
    If you are having trouble with the "Hold Interaction" on a button being "performed" only once then I think you are facing the controls disambiguation problem. Check the documentation for the Hold Interaction under the Process() method. Basically try to change the action type to "Pass Through" and it should work.