Need actor to stop moving when I press a button.

Hi, I have recently set up my logic for moving an actor in a direction continuously. When I press the “break” it will trigger something. But I need it to stop moving when I press the break and move again when the break is not pressed. How do I stop it moving?

I essentially want the cart to move when the break is off and stop when the break is on.

Thank you :slight_smile:

All you have to do is put a branch after event tick, hook it up to a variable, and set the variable to false when you press the button, then true when you release it.

You also might want to multiply the distance moved by delta seconds so your actor’s speed doesn’t vary with framerate.

1 Like