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

Player Input component

Discussion in 'Input System' started by spylefkaditis, May 17, 2020.

  1. spylefkaditis

    spylefkaditis

    Joined:
    Jul 3, 2016
    Posts:
    22
    Probably as stupid question but I can't seem to figure this out.

    How can I detect a "held" button using the new Player Input component?
    All I seem to be able to access is the value of button press when using Broadcast Messages.

    Is the purpose of Broadcast Messages only simple functionality like that?

    How can I detect that a button is being held down?
     
  2. TubbyStubby

    TubbyStubby

    Joined:
    Nov 28, 2019
    Posts:
    6
    You can try using Invoke Unity Events.
    Then you get a callback context through which you can check for performed and cancelled state. If performed and not cancelled then it is being held.
    check this for reference.