how to cancel all other action while combat or dash?

for example i have movement C and attack A and dash B .
allow A or B only when C
and when A do not allow B and C and etc.
i want player to do dash or attack only while idle or move and cancel everything other when attack or dash, until it’s finished.
please help

@qvesk1997

Something you can try to do is set up bools at the beginning of the method to check if they are dashing or are in combat to limit when they can attack.

private void AttackOne(){

 if(dashing) // if dashing is true 
    return;  // exit out of method 

  inCombat = true;
 // so basically if dashing is false then you can do any of the logic below 
// put logic for combat

// either use a timer to tell when inCombat= false or use it in an animation key frame event
}

private void Dash(){

 if(inCombat) // if in combat is true
     return;       // exit out of the method

  dash = true; 

// so basically if incombat is false then you can do any of the logic below 
// put logic for dashing 

// either use a timer to tell when dash = false or use it in an animation key frame event 

}

You can basically just control how they get into actions that way and you can do that for as many things as you need like idle, jumping, movement, anything.