# Action mapping logic problem

**URL:** <https://forums.unrealengine.com/t/action-mapping-logic-problem/441780>\
**Category:** Blueprint\
**Tags:** boolean, unreal-engine, action-mappings, question, Blueprint\
**Created:** [January 21, 2019, 7:06pm UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780 "2019-01-21T19:06:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_04516abb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_04516abb](https://forums.unrealengine.com/u/anonymous_user_04516abb)\
**Post date:** [January 21, 2019, 7:06pm UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780/1 "2019-01-21T19:06:24Z")

</div>

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](https://blueprintue.com/blueprint/xjoogmaz/)

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

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [January 21, 2019, 7:24pm UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780/2 "2019-01-21T19:24:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_04516abb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_04516abb](https://forums.unrealengine.com/u/anonymous_user_04516abb)\
**Post date:** [January 21, 2019, 10:56pm UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780/3 "2019-01-21T22:56:52Z")

</div>

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.

 ![266089-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/c/c3c067dbb95fc453403c682d9e60910b426ef7a2.png)

---

<div class="post-metadata">

**Author:** ![Tuerer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tuerer/32/1008648_2.png) [@Tuerer](https://forums.unrealengine.com/u/Tuerer)\
**Post date:** [January 22, 2019, 10:58am UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780/4 "2019-01-22T10:58:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_04516abb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_04516abb](https://forums.unrealengine.com/u/anonymous_user_04516abb)\
**Post date:** [January 22, 2019, 8:25pm UTC](https://forums.unrealengine.com/t/action-mapping-logic-problem/441780/5 "2019-01-22T20:25:33Z")

</div>

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](https://blueprintue.com/blueprint/m9fbitn9/)

 ![266189-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/b/0/1b0b80950c1b97b2ce35ec78ead15efd65a61aeb.png)
