- Home /
This question was
closed Mar 23, 2014 at 08:59 PM by
getyour411 for the following reason:
Duplicate Question
Turn seconds into minutes and seconds MM:SS
I have this code with a timer on, this timer is displayed on one of my scenes. Now it is working as supposed, there is just a little thing, the timer is only showing in seconds. How would i modify my code, so that it is showing both minutes and seconds like MM:SS, while the rest of the code is still working?
static var energy : int = 5;
var timer : float;
function Start()
{
timer = 1800;
}
function Update () {
timer -= Time.deltaTime;
if(counter <= 0){
energy += 1;
counter = 1800;
Debug.Log("You Have " + energy + " Energy");
}
function OnGUI () {
GUI.Label(new Rect(100,20,400,40),"To Next: " + timer);
}
Comment
Best Answer
Answer by getyour411 · Mar 23, 2014 at 08:58 PM
There's a million of these, just Search/Google
unity convert seconds to minutes
Follow this Question
Related Questions
How to stop a Countdown Timer? 1 Answer
making a timer (00:00) minutes and seconds 10 Answers
Countdown Timer Help About putting 0's 1 Answer
Making a timer 1 Answer