• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Block walking diagonally

Is there a way to block my character from walking diagonally? I just want that he walks to left, right, up and down and he already does it, but he also walks diagonally.
 

Nidoking

Member
In a level appropriate to the amount of detail provided in the question: Yes, there is.

To provide a bit more useful detail, whatever it is you're doing that allows diagonal movement, don't.
 

TailBit

Member
keep track of what direction button you last pressed, with a variable .. then move the character based on that .. if a direction button is released, then you can try check if any other is still down.
 
keep track of what direction button you last pressed, with a variable .. then move the character based on that .. if a direction button is released, then you can try check if any other is still down.
Ok after I'll try this and tell you if worked. Thanks for your help!
 
Top