Make a Infinity Movement When Click a Keyboard Button

Hello, I’m new Unreal learner and this question causing some problems for me. First, I tried to search sooooo much, but I found nothing about it.

I understand clearly about how to movement a character into a level, I did the blueprint correctly and totaly functional, with all axis mapping setted and without bugs. I’m using WASD to movement. My problem is that I need to do movements only in X and Y, separately (If I move forward other directions will be locked to move, but I solved this too) and when click, for example, keyboard button “W”, my player must go forward in Y axis and don’t stop. The character will change movement only if I click other movement button (ASD, in case).

A pratical example:
Character starts game stopped. Then, I click W and it go forward. If I click D, character will continue move for right side but don’t stop any time. If I press A, it turn to left side and goes on and on.

I expect be clear in my doubt and I’m sorry if my english isn’t perfect. English isn’t my native language.
Thanks.

Simple way is to set a boolean variable when the D key is pressed, use a flip-flop to toggle it on and off. Then with your “on tick” event put a branch and set the condition to be that variable. If it’s true then just apply movement to your character in the direction you want. You can use another branch to turn off the D key movement when you press the A key as well.

Thanks a lot Zoltan! This information was so usefull. Thanks :smiley:

Hello. how are they? Could you explain with images why it is something that I also want to do and I am a newbie at this. Thank you

1 Like

thank you very much :+1: