Search Unity

Question Action on Button Release ?

Discussion in 'Input System' started by Thomas-Bousquet, Feb 19, 2023.

  1. Thomas-Bousquet

    Thomas-Bousquet

    Joined:
    Dec 19, 2016
    Posts:
    41
    I'm on 1.4.4/1.5 and using the PlayerInput workflow with SendMessages - I'm trying to trigger an action when a button is released.
    What is the most straightforward way to do this?
    Thanks in advance!
     
  2. rdjadu

    rdjadu

    Joined:
    May 9, 2022
    Posts:
    116
    Put Press interaction on the button binding, set its behavior to "ReleaseOnly".
     
    Thomas-Bousquet likes this.
  3. Thomas-Bousquet

    Thomas-Bousquet

    Joined:
    Dec 19, 2016
    Posts:
    41
    Thanks, it works! "Press" interaction feels like a pretty confusing naming convention to find the Release behaviour under.
    For Unity peeps, maybe that info could be added to the How Do I ... section of the documentation?
     
    Last edited: Feb 23, 2023
  4. MatanYamin

    MatanYamin

    Joined:
    Feb 2, 2022
    Posts:
    110
    You also can subscribe to the "cancelled" event that will be triggered when the button is released.