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

New Input System : How to use the "Hold" interaction.

Discussion in 'Input System' started by Xynhay, Dec 31, 2018.

  1. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
    My custom hold interaction here: https://gist.github.com/Invertex/db99b1b16ca53805ae02697b1a51ea77
    has an option for triggering .started only after the button has been considered "held" for enough time. As well as an option to set a trigger interval for .performed while it's held, instead of per-input-update.
     
    Rouddem likes this.
  2. Rouddem

    Rouddem

    Joined:
    Dec 15, 2015
    Posts:
    14
    Wow thanks !
    I haven't read the page 4 :x
     
  3. mahito2932

    mahito2932

    Joined:
    Nov 15, 2020
    Posts:
    89
    Yeah the only problem about this one is that it only work in Unity Editor after you go to build that for an Android or PC it stopped to work maybe due to UnityEditor usage
     
  4. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    857
  5. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
  6. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,495
    The editor usage is wrapped in macros to avoid issues in build, just like Unity does it. I register it the same way they do as well.
    Could you give me more details?
    Platform, Unity and Input package version?