Basic character movement setup question using blueprints

Basic character movement setup question using blueprints

Ok so I have been able to do a great deal of building on my prototype, but I am stuck on a very simple task.

For the Pawn motion, I have the default keys and using "w" for forward motion.
But you have to hold the key down all the time to keep moving.
SO, all I want to do is add another forward motion key "r" that you press once, but that it creates the constant forward motion until the "w" key is pressed again.

I created a key action with "r" named "ConstantMotion" with no luck setting it up, also tried adding a variable called "ConstantMotion" with default speed at 600,
but it caused the pawn to move all the time no matter what key I pressed.

No luck on this, and any help would be greatly appreciated.

Basically you want either a flip/flop node, or a bool. Either way works. Bool might be easier to understand.

Basically, your input axis is a constantly changing variable that either reads 0 or 1 whether you’re pressing it or not. So you can use the same running code but with a 0 or a 1 to turn it off and on.

Make a bool variable on your blueprint, call it “is running”

On the blueprint, on Input Action Pressed, do Get Is Running and then a Branch, plugged in to the Bool which goes to the running code with an input of 1 on false, and does the running code with an input of 0 on true.

To make the input of 0 you should be able to just type it in, or you can make another variable and do a get/set before each run code, after the branch!