Force stand still on button press

Hello My game is the click to move preset basically. And id like to set up a way for they player to be able to press a button and cause they character to immediately stop moving, then when they let go of the button the character can move again.

The setup i linked yields decent results but you have to press and release space when you start the game to start moving then when you press space while moving, it stops receiving an input but it continues to the location that was clicked. So im close. The logic is in my head like if “Space” is pressed break input but im not sure how to make it happen. as always any help is appreciated.

Inside MoveToLocation Function, there is some math to define WHERE TO GO. Just store this vector in a temporary variable when press space, and then, call it the same END node inside MoveToLocation again feeded with this var.

Thanks for answering so fast! But Im going to ask you to hold my hand a bit more through this. So I’m inside of the “Move To Location” function the rest of what you said is very alien to me. I’m not sure how to do the rest of whta you said. hopefully you can walk me through this a bit more

Here is a look at the inside of that function on my screen

The Yellow node, Location → Goal. Save to a vector var at moment You press apace bar, and then, call StopMove.

64078-

Like this? im not sure how to make it so it save the variable the moment I press space. I cant seem to call the keyboard event inside of the function. in the Event Graph I can

Yes but you need to connect the In Arrow to realy save this value

Alright like this?

I assume thats wrong because is doesn’t incorporate my keyboard input or the Stop Moving function.

Yes, Now You know where You are going at first, so. Now, make a gate like first ScreenShot, If first press scape, STOP. If second press Scape, call last node with this vector.

So i have the input, the gate, the Stop Movement function, and the location variable. so when pressed it should stop the movement, and when release it should go back moving normally. So what goes where in this picture.

I dont see where the Location would plug into.

Sorry about gate… Its just a boolean test. Stop starts true. And remember to set to TRUE each click on ground to reset.

Alright now were cooking! Thank you for being patient with me. A lot of this is very foreign to me. im curious is there anything that i need to do with the “Stop” boolean variable? another little hiccup I had is that when I try to connect a controller variable to the "controller part of the Simple move to location, I can’t name it “self” because it says “self is in use by another variable or function!” so this is my current setup (looks just like yours)

With this set up, in game when I click a space to move and press space he stops moving then i do it again and it skips the stoping and continues and on the third try it stops him again. alternatively if i hold down the click and press space while i drag the mouse around the clicking seems to to override the stop, he stops for just a second and continues towards the cursor. Again that is when i hold down the click. if you are confused i can upload a Gif of this later on

You dont CREATE this var, this var is already created, self is a reference of this blueprint. Just click and drag and with context menu, search for self.

Alright I fixed that bit here is a gif of what it does in the game viewer with a bit of text to describe it.

64099-movement.gif

I want the stop moving to even work when i click and drag. So how can i do that? again than you for your patients!

Solved