//Variable for in-game timer
var myTimer : float = 30;
//Script for the in-game timer
function Update () {
if(myTimer > 0){
myTimer -= Time.deltaTime;
}
if(myTimer <= 0){
Application.LoadLevel (2);
}
}
//Script to implament the in-game timer
function OnGUI(){
GUI.Label(Rect(10,10,200,50), "Time: " + myTimer);
}
I have set up a timer for my game, however I would like to remove the numbers after the decimal and display the time in whole seconds.
I just don't know how I would do that, any advice would be great.