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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

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:
    99
    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:
    105
    You also can subscribe to the "cancelled" event that will be triggered when the button is released.