How to make a distance travelled counter stop

I’m working on a distance travelled counter, and got it so far working that it already displays measuring the distance for my vehicle. But I also want to be able to stop the distance counter with a button press, for example when I press the brake pedal of my vehicle. Is there any way to do this and still show the last measured distance on screen instead of removing the widget all together?

use a timer instead of the delay node and then you can start and stop it as needed

You mean instead of using a delay, use a set timer by event?

exactly, save the timer handle and you can call an event to clear and invalidate when you wanna stop.

while your at it, id create the widget once in the player controller and have it bind to the add distance event, otherwise every time you overlap its creating more widgets

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.