Diagonal movement animation

Hello again!

I’m wondering how to animate player’s diagonal movement with the top down behavior?

My character moves in the eight directions but the animation freezes when I hold down two buttons at once. I tried to change the animation for when two buttons are held down at once but the freezing continues. I’m sure it’s a simple thing, I just haven’t figured out.

The “Hidden” variable is just me playing with changing character animations when “underneath” objects on the map.

1 Like

Your current event sheet won’t work for 2 reasons:

You have animations for S key is pressed
You have animations for D key is pressed

You have animations for S AND D key is pressed, which will directly conflict with the above two.

You will either need to:
Add a “key is pressed” that is inverted for EVERY other directional key
or
Add some kind of “keys pressed” global variable that increases for each key pressed, and decreases for each key released, and set up the 1 key pressed animations to only work when that variable is 1, and the combo key presses to only work when that variable is two.

Edit: Also, separate your animation from your movement entirely. Either with sub events or duplicating the conditions. Your animations need to have conditions of “Trigger once” otherwise they’ll restart every single frame.

2 Likes

Hello,
Sorry to revive this. So I understand that my two movement keys are clashing with each other, I don’t get the:

Add a “key is pressed” that is inverted for EVERY other directional key

Could I get an explainer please?

i think he means like this:
image

so the “a” movement is ONLY triggered if a and only a are pressed. for an A and D combo angled move, you’d have this:
image

1 Like

hehe. just realized you’d never do an A and D combo. doh! Hopefully the idea still came across.

Thanks! Yes you made it clear. That wasn’t the issue.
E: I’m retarded. It works. Thanks again!~

I have had this problem for ages, thank you so much for the solution, i cant express just how happy i am right now.

1 Like