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

Resolved There is a request for InputSystem in Unity official.

Discussion in 'Input System' started by kenzen0, Jul 24, 2021.

  1. kenzen0

    kenzen0

    Joined:
    Sep 17, 2018
    Posts:
    16
    I have a request about InputSystem.
    I want to be able to easily get a bound GetButtonDown like the old Input.

    Example
    Old days
    if(Input.GetButtonDown("Fire")){Debug.Log("Fire");}

    Future
    if(_PlayerInput.actions["Fire"].wasPressedThisFrame){Debug.Log("Fire");}

    Why is there no wasPressedThisFrame for actions?
    I would also like to ask if there are plans to implement it in the future.
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,996
    It is called triggered.
     
  3. kenzen0

    kenzen0

    Joined:
    Sep 17, 2018
    Posts:
    16
    Thanks.
    But with "triggered", I get both ButtonDown and ButtonUp.
    I only want to know ButtonDown.
     
  4. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,996
    That's strange. I only get one triggered = true, when the performed activates. Are you sure you set up the action properly?
     
  5. kenzen0

    kenzen0

    Joined:
    Sep 17, 2018
    Posts:
    16
    Oh, excuse me.
    The Action setting was wrong.
    Lurking-Ninja fixed it for me, thanks!
     
    Lurking-Ninja likes this.