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"

Get a button press to check a bool value every frame?

Ok I've tried looking online and through these boards for an answer but I can't find specifically what I'm looking for.

Here's my blueprint setup inside the player pawn... really simple:alt text

Everything is technically working, but not quite the way that I want it to. In this setup, I have to press Shift BEFORE pressing W otherwise the branch sees the state as false and then NEVER checks again to see if the state has changed until I release W and then Press it again. I want to be able to press W, have it read false, and then later check to see if the state has been updated. I can't drive the state with an Event Tick because I don't want the function to be called every frame, I just want it to check if its been updated without having to let go of the W key.

Any ideas how to do what I want?

Product Version: UE 4.8
Tags:
more ▼

asked Oct 16 '15 at 01:06 AM in Blueprint Scripting

avatar image

TorQueMoD
1.1k 82 112 143

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

1 answer: sort voted first
more ▼

answered Oct 16 '15 at 03:02 AM

avatar image

Stunt Thumper
175 13 19 33

avatar image Stunt Thumper Oct 16 '15 at 03:26 AM

woops forgot i have 3 monitors haha. I made a quick example in the left screen. I think it should do what u want let me know.

avatar image Stunt Thumper Oct 16 '15 at 03:34 AM

Here alt text

sprint.png (157.2 kB)
avatar image TorQueMoD Oct 16 '15 at 05:09 AM

Thanks for the help guys. Yeah, I'm not actually moving the player with this code, I'm simply playing an animation on top of the code that already exists to move the player forward so I don't know if the axis mapping would work. I actually tried that and it didn't have any useful effect because it just ended up playing my animation constantly. Hence why event tick doesn't work in this situation because I don't want the animation to play every frame, I just want to be able to let W know when I do toggle the Run and Walk with Shift.

Stunt Thumper, I think I'm too tired right now to make sense of what you did but it looks like it MIGHT work so I'm gonna try it tomorrow once I'm fresh again :) Essentially what you did is create a bool to check if I'm pressing W and then as long as W is pressed, if I press the shift key it will call the running state and when I release the shift key it will call the walking state. Is that right?

So essentially use the shift key to toggle the states rather than W... yeah I think that will work. I'll let you know thank you :)

(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