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

Question Make hierarchy for Input Actions

Discussion in 'Input System' started by Arkain, Jun 1, 2023.

  1. Arkain


    Jun 20, 2017

    I'm kind of new with the new input system and there is something I don't understand.
    I've set 2 actions in the PlayerInput : Jump and Attack.
    So I call them with OnJump and OnAttack.
    But if both of them are called exactly in the same time (if you press the two buttons in the same time for exemple), both Actions are executed, and i would like only one of them to be executed because you're not supposed to jump and attack in the same time.

    So is there a way to make a hierarchy between Actions or something like that to avoid problems when both Actions are executed in the same time ?

    (sorry for bad english)
  2. unormal


    Jan 10, 2012
    AFAIK, you would have to manually implement some order of precedence and check them in that order (and not check lower precedence ones if higher precedence ones fired)