Hi, I want back to my menue when I lost my game, so when the time up. But timer disappears when the time is zero, so that works but it doesn’t load my menue/scene.
Can anyone help me please
timer.js
#pragma strict
import UnityEngine.UI;
var countdown : float;
var timer : UI.Text;
function Start () {
}
function Update()
{
timer = GetComponent(UI.Text);
countdown -= Time.deltaTime;
var minutes = Mathf.Floor(countdown/60).ToString("00");
var seconds = (countdown % 60).ToString("00");
timer.text = minutes +":" + seconds;
if(countdown <= 0.00)
{ timer.active=false;
Application.LoadLevel("Lostgame");
}
}