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:

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?

Here you go sir

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.


Hes calling functions not actually moving

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 :slight_smile: 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 :slight_smile: