x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

action mapping logic problem

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

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

Product Version: UE 4.17
Tags:
more ▼

asked Jan 21 '19 at 07:06 PM in Blueprint Scripting

avatar image

Ahmed_123
3 2 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Jan 21 '19 at 07:24 PM

avatar image

Tuerer
1.8k 12 7 8

avatar image Ahmed_123 Jan 21 '19 at 10:56 PM

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.

alt text

capture.png (190.9 kB)
avatar image Tuerer Jan 22 '19 at 10:58 AM

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.

avatar image Ahmed_123 Jan 22 '19 at 08:25 PM

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

alt text

3.png (343.2 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question