Checking for true variables

I’m trying to make a game where you can perform different actions with sequential inputs, and to do this I’m trying to check which variables are true at any one time and performing an action based on which ones are true. I want to do this without just a bunch of if/then statements. Is this possible, and if so, how would you do it? (For example: holding right while jumping and then pressing down makes you dive)

Your example has a couple of if statements already…

(For example:
holding right (implicit if statement) ==> if holding right
while jumping (implicit if statement) ==> && if jumping
and then pressing down (implicit if statement) ==> && if pressing down
makes you dive (Action)
)

in code would be like…

if( holdingRightArrow && isJumping && pressingDown ) 
{
      dive();
}
1 Like

Thanks, this helps a lot!