How do i stop the input of other directional keys?

There are a lot of problem i am not sure you are aware of , making this .
But here is , you just put a variable, like my direction.
You check if the direction still 0 when you press, then put it the right value.
Any key pressed, will be ignorated until that previous key will be released.

There is the normal version. but to make it easy to reproduce for every key i have made you the collapsed.
In wich you have only to tell wich is the number of the direction. 1, up , 2 left, 3 down, 4 right.

I’ve set up a capsule on my character that moves to the direction of where the character is facing, but if i press more than one key at a time, my character flies off the map. i need to set up something that either overrides the current key that is being pressed, or prevents the other key from being activated before the current key is released.

it has improved the character movement if im already holding down a key, now i need to find a way to fix the skipping if i press two keys at the same time

Take some hd screenshot about all , there is something wrong elsewhere.
Even if you have an error that make you choose the wrong direction, or a fusion of directions, i dont see how should it fly away…
I see you get the world location of something and set it , i would see what.

the objects im getting world location of are the capsules around my character

71452-character.jpg

then i move another capsule with overlap events to their locations depending on which direction the character is facing. im doing this so that when it is moving i will be able to interact with objects in my world, and so that my character will be facing the right way when interacting with them.

Decided to scrap the moving capsule, it wasnt going to work. ill figure out the overlap events another way.