I have this piece of code that does a countdown and it works fine, but it shows the numbers
5 places after the decimal does anyone know how I can get rid of this? I wouldnt even mind it just showing the numbers 2 places after the decimal. More preferably I would like the numbers after the decimal gone though. here is my code:
var timeLv1 : GUIText;
var timer : float = 30.000000000;
var outOfTime : boolean = false;
function level1 () {
timer -= Time.deltaTime;
timeLv1.text= "time: " + timer;
if(timer <= 0){
timer = 0;
outOfTime = true;
}
}
function Update () {
if(Application.loadedLevelName == "gameLvl1"){
level1();
if(outOfTime){
GameOver();
}
}