Search Unity

Question Make hierarchy for Input Actions

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

  1. Arkain

    Arkain

    Joined:
    Jun 20, 2017
    Posts:
    1
    Hello.

    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

    unormal

    Joined:
    Jan 10, 2012
    Posts:
    65
    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)