How do I make it so only one key can be used at once

I just need to figure out how to make it so only one key can be pressed at once. I just only need to know this to prevent corner movement in my game. I don’t want to use the behaviors because I feel that the movement system I have created is perfect for me, I just need to prevent corner movement for the feel of a classical RPG game.

It’s definitely fine to create your own movement behaviour.
However, how are you making the player move currently?

As an example, in my game (which has corner movement) checks what directions the player has pressed on the controller (AxisX = left / right directions) and then translates it into movement in the second picture, which are serparate events.



To prevent corner movement in this system, in the first event in the second picture, I’d add an action that sets the global variable Input.AxisY to 0, so the player won’t move upwards or downwards.
That does have a problem though, if the player holds down button Up and then presses Right, the character would immediately go right, and yet if the player holds down Right then presses Up, they would still be going right. You can reverse the order of events so that it will be a “vertical priority” instead, but it’s not the best/accurate way if my memory of Final Fantasy 3 holds up.
I dislike sounding so direct, but pictures of your events would still help.

By the way, If you can implement Silver-Streak’s “last key pressed” mechanic from your last topic that would solve this “horizontal priority” problem. It seems daunting, but the returns will make your movement mechanics easier to work with.