Action mapping logic problem

All W-S and A-D change the Walk/Sprint/Idle values when pressed and released, and they interfere with each other, because Axis input runs on tick, i.e. all the time. E.g. You press W and D and you walk forward and right, but then you release D and it sets Walk to False, but W is still pressed, and every tick Walk is set to True and False right away.

I set up some code to detect when I pressed a button and when I released it (to make it easier while coding only) then I set up some other code to know if I am idling, walking or sprinting, and checked this out with printString nodes on the event tick. I set up this on the “W” key and it worked just fine, but when I copy the code to other keys it doesn’t work at all.
here is my blueprints, logic problem posted by anonymous | blueprintUE | PasteBin For Unreal Engine

hope someone can help me cause this doesn’t make any sense.

Thank you so much Tuerer for your reply … one thing to mention is that I already set up something to detect when I release the button, (to check the value of the variable “WS_Value”, and if it is = zero, which means I released the button, then set both bool variables “W” and “S” to false).
I don’t know if I got your point or not but thanks so much bro for your reply, I am still stuck at this point and I will try to find it out.

You can try combining both axes into one vector at the very beginning to have a 2-vector and clamp its length between -1 and 1, and then do everything else. It will eliminate one branch and make it easier to debug.

Thank you so much, bro … that’s an amazing solution … actually I tried to play around the problem and it has been solved … I created a sequence node that is fed by all output execution pins of all input booleans (whether true or false) and out of that sequence node I checked the booleans again to run the functions of idle, walking and sprinting.

Here is what I have ended with: input (Solved) posted by anonymous | blueprintUE | PasteBin For Unreal Engine