WASD Control

Hello. This is my setup to make my character’s armature play its running action when I press the W key and to play the idle animation when I release it.

It is also set to play the Idle animation when the game starts. How do I make the A, S, and D keys also trigger the run animation, and make the Idle animation play when I press no keys?


Try this setup for Run:

and this for Idle:

best regards,

Thanks again, QuantumCoder! I tried that setup. It work OK, but it deactivates the run animation when I release any of the four keys. For example, if I’m holding the W and D keys, then release D but am still holding W, it stops. Is there a way to keep the run action playing as long as any of those four keys is pressed?

You’re welcome @cholm,

I improved on my setup, try this:

What I do here is increment an Integer every time a button is pressed, and decrement it when released. That way I can keep count of how many keys are still pressed down.

Then, on every key release, I check if there is any key still pressed down. If not, then play Idle animation.

Best Regards,

That solves the problem. Thanks again!