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"

InputAction not deactivating after release of designated button

So in the picture in the red squared area, you can see I've set up a system for walk run and sprint. I want the walk anim to be toggled and that IS working properly currently.

However, the sprint button (connected to left shift) is working as a toggle as well, even though my intention is to have it be a press-release like most games are for a sprint anim..

Essentially, as long as left shift is held down, the characters speed is set to sprint speed, and when it is released it goes back to run speed.

Based on how this is set up what would be causing this?

alt text

Product Version: UE 4.19
untitled.jpg (399.2 kB)
more ▼

asked Jul 19 '18 at 10:42 PM in Blueprint Scripting

avatar image

64 4 6 9

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

2 answers: sort voted first

By the way found out what this was.

I had checked the shift checkbox next to the drop-down box in Input settings while designating Left Shift as a button.

For some reason that checkbox makes it so when shift is released the system does not register it.

more ▼

answered Jul 21 '18 at 11:11 PM

avatar image

64 4 6 9

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

Not sure seems like it should work in theory BUT, why bother with the extra branch node and check on movement state? You want EVERY time space is pressed for the player to sprint no matter what...and EVERY time it is released to go back to a "run". So why not code that instead? You are giving the computer more places to create a weird bug. Just go from input action sprint pressed to "set movement state sprint" and on released "set movement state run". Seems like it would do the exact same thing without that intermediate check on current movement state.

more ▼

answered Jul 20 '18 at 01:22 AM

avatar image

Nebula Games Inc
5.4k 28 9 14

avatar image Plzwork1234 Jul 20 '18 at 01:32 AM

Because he will sprint from a walk if I don't do the branch checks. The only way he can sprint is if the user has toggled off walk, and the character is now running. So he can only start sprinting from a run.

Im not so much concerned about that though as I am that the release of left shift doesnt do anything. It doesnt matter how I arrange things. Any ideas on that?

avatar image Nebula Games Inc Jul 20 '18 at 02:18 AM

I don't think so. Your sprint logic says

  1. On pressed Check movement state

    If walking --> set to sprint

    If running --> set to sprint

    If sprinting --> set to run

  2. So say player was previously walking, they then press the "Input Action Sprint", the branch will check the current movement state and see it was "walking" return a "false" and set movement to "sprint". On release it is going to check movement state see "sprinting" and return true and set movement to "run".

  3. I would put 2 print strings one after "pressed" one after "released" make sure they fire off appropriately there first

Let me know what that says.

avatar image Plzwork1234 Jul 20 '18 at 03:39 AM

Well I can tell you what happens in-game. If the char is walking and I hit shift/sprint he doesn't sprint. Continues to walk as he should. I then hit Tab which toggles run on. THEN while he's running I hit shift which does in fact send him into the sprint, but when I release shift he continues to sprint.

I did just do that string check and you're right, pressed pops up on the screen but no "released" when i release shift. So the system isn't even detecting that I'm releasing shift?? Very strange.

(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