Making a Stopwatch in Blueprints

So I have a stop watch in the game, and it is very important that it works well, and it is also important that it stops, and continues right where it left of last when I tell it to.
That however is the problem with the current code, so I recently tried this new method and unfortunately what this method does is, it starts to count at the very start of the playtime, but I want it to start when I say so.
Not just that, but when I stop it using a command, and when I start it up again, it doesn’t continue where it left of, but it was still counting in the background.

I know exactly why this happens, but I want to know if there is an alternate method that gives me these options I need.
Is there a different node I can use instead of Get Game Time In Seconds node?

I think the best solution for you is to store the current time when you start the watch, let’s call this variable StartTime, then, at the time to calculate the actual time, all you have to do is GetTimeInSeconds() - StartTime. In this way, you will have a counter that starts from zero and your blueprint should work. Of course, you have to remember to update StartTime when you unpause the watch.

You use timers! They already have all the features you need.

Can call the functions on any input.

And can display the data anyway you want.

I think this is exactly what you wanted to achieve :slight_smile:

1 Like

You could also create a “Simpler” timer with just an int and a bool, like this:

each iteration it adds 1, which in this case is a 10th of a second.

You can call Start, Stop, and Reset from any input you want:

263442-1.png

And just to see what’s going on, here’s how you can print this:

all 3 “ToText (Integer)” are the same btw.

timers can do all of this already =)

Thank you for your answer.
I’m trying to get this to work, but for some reason the miliseconds arent showing, not not sure what exactly you call those anyways, I’m talking about the number that goes up to 99 and then turns into 1 second.
So yeah its not doing anything for me, did I do something wrong that its not showing?

True, I guess it is the better answer.

Glad to help!

Remember to mark the answer as accepted so this question shows as [Resolved]

Oh I think I got it to work, Thank you so much for this, you are awesome!

Thanks for your help!