I am trying to make a functioning digital clock and it works except for the fact that I cannot seem to get the minutes to reset after 60.
var textObject: GUIText;
private var mouse: boolean;
mouse = false;
private var count: int;
count = 1;
private var Minute = 60;
function OnMouseOver ()
{
mouse = true;
}
function OnMouseExit ()
{
mouse = false;
}
function Update () {
var hour: int;
hour = 0 + Time.time / 60;
var minute: int;
minute = 0 + Time.time;
if (Input.GetKeyDown("e") && mouse == true)
{
textObject.text = "The time is " + hour + ":" + minute;
}
if (Time.time > 59)
{
minute = minute -60;
}
}
I was wondering if anyone knew what was wrong with this code