Help with timer guitext

Hey im using two scripts, startRace & endRace, which starts at 60 seconds counting down when you trigger it and stops when you hit the other trigger. Can i just add some coding into these codes which make it a guitext and displays on the screen. Thank you.

startRace :

using UnityEngine;
using System.Collections;

public class startRace : MonoBehaviour {
 
 public bool raceStarted = false;
 public float raceTimer = 60.0f;
 public bool raceOver = false;


 // Use this for initialization
 void Start () {
 
 }
 
 // Update is called once per frame
 void Update () {
 
 //Starts timer when race starts
 if (raceStarted)
 {
 raceTimer -= Time.deltaTime;
 }
 if (raceTimer <= 0.0f)
 {
 raceOver = true;
 raceStarted = false;
 Application.LoadLevel(0);
 }
 
 }
 
 void OnTriggerEnter(Collider raceTrig)
 
 {
 
 //Starts race
   if(raceTrig.gameObject.tag == "Player")
 {
 raceStarted = true; 
 }
 }
 
}

endRace:

using UnityEngine;
using System.Collections;

public class endRace : MonoBehaviour {
 
 private startRace race;
 
 // Use this for initialization
 void Start () {
 
 race = FindObjectOfType(typeof(startRace)) as startRace;
 
 }
 
 // Update is called once per frame
 void Update () {
 
 }
 
 void OnTriggerEnter(Collider raceTrig)
 
 {
 
 //Stops timer and ends race
 
 if(raceTrig.gameObject.tag == "Player")
 {
 race.raceStarted = false; 
 }
 
 
 }
}

Well here’s a basic display of text in OnGUI:

void OnGUI()
    {
        GUI.Label(new Rect(x, y, width, height), raceTimer.ToString());
    }

You should alter the Rect to position it to where you want.
You should also take a look at

to understand how to alter the style, size, etc. of your text.

This should help you on your way :wink: cheers

I want to add a guitext, to this script so that when my player hits the collider, it will freeze the game and text will appear saying “you win” for 5 seconds then go back to my main menu. The player is already hitting the collider and the timer is stopping but the player is still able to move.