One ability that uses multiple inputs

I’m having an issue while trying to implement actions that require a button press and a joystick direction. The joystick should determine movement as well as modify abilities but if they aren’t pressed in the same frame, then the character either moves or performs the unmodified ability. My first thought is that I should create a delay timer that checks for other input before performing any abilities. Pretty sure that would work but I just wanted to check if there was a better solution out there for what I would expect to be a ubiquitous issue.

Any responses are super appreciated <3

So the time-window for accepting input is too small… As soon as joystick direction has value, you can AbleToUseModifiedAbility = true and use Time.deltaTime(float timeWindow) to count. If it reaches the max(during joystick direction) then bool AbleToUseModifiedAbility = false and timeWindow = 0f.

I don’t know if this is the most efficient way but it’s probably how I’d do it

I would check to see if a button is held down when you check the directions. You could have this set up in a switch statement. Something like:

if(Left){
switch(button){
case A_BUTTON:
AttackLeft();
break;
case A_BUTTON:
ShootLeft();
break;
default: //no button
MoveLeft();
break;
}
}