How to make stopwatch?

Hello, I don’t want to annoy anyone, but I need little help.
I’m making one small game and I really don’t know, how to make stopwatch. I watched a lots of videos, but practicaly none of them wasn’t like my idea.
I wanted to make it like this:
For example: 00:00:00 (MM:SS:HS - hundredths of seconds)
Starting count from 0 (Logically.) and then stops, when reaching finish line.

I know, I did described it pretty bad, due to my bad english.
But if somebody did understand, what I mean, please help me at least a little bit.

Thanks!

Thats quite simple:

Create a BP float variable, add Delta Time to it on every tick, then divide the result by 60 to get minutes. combine these values with the string append BP function. For the seconds, use the truncate function as we don’t want the fraction of the seconds. Now for the hundreds of seconds, simply use the fraction function. For simple testing, use the print string function. Once everything works, you can tackle the GUI part :wink:

As for stopping the watch, you can use the OnOverlap event to stop accumulating time.

Thanks TriNityGER, but I didn’t get it. Could you please send me a picture of how it looks in graph? If you don’t want I won’t be angry :slight_smile: Thanks.

Here’s a more detailed example. In addition to all this, you need to add a box collision component to your blueprint so you can actually overlap with the finish line to stop the stopwatch.
This should provide you with enough material as a starting point :slight_smile:

2 Likes

Thanks! I can’t believe you went through all that effort to help a guy out. We need more people like you on these forums!!!