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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

preview.5 - Hold Interaction sticks / always cancels?

Discussion in 'Input System' started by OUTTAHERE, Feb 19, 2020.

  1. OUTTAHERE

    OUTTAHERE

    Joined:
    Sep 23, 2013
    Posts:
    658
    (reading through the release notes for preview.5 shows me the behaviour is SOMEWHAT by design, but the getting stuck is something the release notes expressly state was tried to circumvent - either way, a means to detect the state of the cancellation is somewhat sorely missing. at least it's good to know it's missing, and the source documentation should be updated as such - still stays canceled doesn't happen when performed happened, and vice versa)

    Hi, I've been trying to make a Hold action that after Holding North/Y on a Game pad for a second performs.


    Now, If I make the Action Type for r-drive a Button, that makes the interaction behave exactly like it should until it gets performed, and then it is dead - just stays performed indefinitely, no chance of getting it back. Reset() doesn't do anything. I don't think this can be intentional functionality?



    If I make the action type a Passthrough, it repeats & recharges, but I always get a "canceled" event (the docs for canceled state this should only happen when not fully performed!), and I am looking for a way to either prevent that, or to find out whether cancellation happened after a successful performed or before.

    I also referred to the Input Tester sample, that uses directly serialized Actions without an Action Map.


    When I do the same, my code behaves like the input tester, which, too, collects these extraneous "canceled" states, with no means of knowing whether the action was performed, other than tracking state elsewhere, outside the Interaction...?
     
    Last edited: Feb 19, 2020
    albrechtjess likes this.
  2. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    329
    The first one its an error, im sure of that, Hold souldnt execute just once

    But the second example, Passtrough make it possible to use more bindings at the same time
    also canceled works withouth interactions when you put it in pass through

    For me cancelled is useful cause i havent to worry about to put an action to cancel another action

    for example (This is the one i like the most)
    inputs.Gameplay.Inventory.performed += x => OpenInventorr;
    inputs.Gameplay.Inventory.canceled += x => CloseInventory;


    instead of (this requires extra configuration in the ActionMap Asset)
    inputs.Gameplay.OpenInventory.performed += x => OpenInventory;
    inputs.Gameplay.CloseInventory.performed += x => CloseInventory;



    but im completly with you that Hold interaction Souldnt Fire just once when not in "Pass Through"
     
  3. albrechtjess

    albrechtjess

    Joined:
    Oct 11, 2017
    Posts:
    11
    I have this same behavior and same question, I feel like something isn't working as expected.Mine is in preview 7 though. It just gets stuck on performed and never goes back to detecting/listening for further inputs or started events.