I am creating a side-scrolling platformer whose controls are based on the movement of most fighting games. That means if the player jumps vertically up, there is no horizontal movement. I got that taken care of.
HOWEVER, to perform flips, players must press FORWARD and UP at “the same time” (to flip forward) or they can flip backward (by pressing UP and BACKWARD).
I attempted to do something like:
if(Input.GetAxis("Horizontal") > 0 && Input.GetAxis("Vertical") > 0)
but that doesn’t work. I do not want to hard-code the input like this because what if I allow the player to change the controls later? Not every player will agree with my keybindings!
if((GetButtonDown("S") && GetButton("W"))
|| (GetButtonDown("W") && GetButton("S"))
{
// Do Flip!
}
S = move to the right
W = move up (jump)
THANK YOU IN ADVANCE!