I have my lap timer up and i want to hold the values for the “last lap”
On each lap the timer get reset…
So how can i read and hold the values unitl next reset and so on…?
Basically read and hold a value once???
I have my lap timer up and i want to hold the values for the “last lap”
On each lap the timer get reset…
So how can i read and hold the values unitl next reset and so on…?
Basically read and hold a value once???
Create a variable to hold the ‘last lap’ time.
Before resetting the lap time, assign its value to the ‘last lap time’ variable.
Ok… doesn’t that way last lap updates with current lap??
Nvmnd fixed. I had a prblem with how i was using the trigger collider event.
What do you mean?
[Edit: Ok, never mind :)]
hehe… now that i have this post up… how do you do to allways use a double int? like i want to express the time like 00:00:00 but i get 0:0:0 :? unless it’s grather than 9 of course heh
What programming language are you using?
JavaScript
I’m not familiar with Unity javascript, so I can’t give you specifics. However, most languages will offer string formatting of some sort as a built-in feature or as part of their standard library, and a common ‘string formatting’ feature is the option to ‘pad’ numbers to a specified number of digits.
Again, I can’t tell you off the top of my head how to do this in js, but I’m sure someone else will be able to.
JS uses .NET just like everything does in Unity, so it’s no different than C#.
–Eric
In easy dialect that would be? ![]()
Try Googling ‘net string format’; you should be able to find some examples that way.