Discuss Scratch

YaBoi_Kenny
Scratcher
50 posts

Prevent moving diagonal

I working on a game and I don't want to move diagonally. I kinda got it but it's not exactly what I want. When I went to find out, I found a Reddit post about this. One of the replies said there were three options to prevent diagonal movement:

1.) Player stops moving (Left + Up = Stop)
2.) Let go of the previous direction to go the next direction (Left + Up = Left, until release left)
3.) The next direction cancels out the previous direction (Left + Up = Up)

I'm trying to find out the 3rd method, can anyone help out?

Last edited by YaBoi_Kenny (Feb. 17, 2022 22:54:27)

_ZazyDev
New Scratcher
20 posts

Prevent moving diagonal

just make a “check script” to check if two keys are pressed together if they are change x and y by 0
YaBoi_Kenny
Scratcher
50 posts

Prevent moving diagonal

_ZazyDev wrote:

just make a “check script” to check if two keys are pressed together if they are change x and y by 0
I'mma try that thanks, I'll post again if I have another problem.

Powered by DjangoBB