Actor moves diagonally when i press two movement buttons at the same time for movement
Mayhem_Madness
Member, PRO Posts: 168
Hello, I have an actor, that can move up, down, left and right. When i press, lets say up and right together it moves diagonally, or when i press the up and right, one after another really quickly, it moves diagonally.
So my question is what would i have to do, so it doesn't move diagonally?
Thankyou.
Comments
Do you have a question ?
Yes what would i have to do, so it doesn't move diagonally?
I've had this happen to me before. You either separate the buttons on the screen so a two-axis movement does not occur, or you write a boolean to lock out the "other" movements while your intended movement is executed.
My Blog / App Store / Google Play
Put the rules inside the otherwise sections of other rules.
For example:
Rule if key up pressed
-Move up
Otherwise
-Rule if key right pressed
--Move right
-Otherwise
--Rule if key down pressed
---Move down
--Otherwise
... Etc.
Ok thankyou.