I use the movement behavior in 8 directions. I turned off the diagonal movement there. But, when you press two buttons, the sprite still moves in one of the directions-up, down, right or left.How do I disable pressing two buttons?
Sorry, I didn’t understand. Are you trying to tell that:
If you are pressing up key and object is moving up
After that you press down at the same time, that’s when object stops moving up and goes down
Do you not want that to happen?
Sorry, English is not my language. If I press the buttons to the right and up (for example), then I want the sprite not to move. So that the movement was one button at a time
You can restrict the movement to only one button with something like this.
This way you’re setting
IF
Up or W are pressed
AND
not pressed Down, Right, Left
THEN
Simulate Up for player
@UlisesFreitas did the right thing. You need to do something like this for all your direction.