Question by
Myblockbuilder · Sep 02, 2017 at 03:24 PM ·
levelstimer-scriptgameover
I'm trying to make my timer stop and display on the level complete scene
i made a timer to count how fast you can beat the level but i cant find out how to make it display it in my level complete scene, because after you beat the level it loads the level complete scene and it wont display it
using System.Collections;
using UnityEngine.UI;
using UnityEngine;
public class Timer : MonoBehaviour {
public Text Timertext;
private float startTime;
// Use this for initialization
void Start () {
startTime = Time.time;
}
// Update is called once per frame
void Update () {
float t = Time.time - startTime;
string minutes = ((int) t / 60 ).ToString();
string seconds = (t % 60).ToString("f2");
Timertext.text = minutes + ":" + seconds;
}
}
Comment
Your answer
