Your Cart
Loading
unity digital clock how to make digital clock in unity tutorial unity real time clock

Unity Digital Clock | Unity Tutorial

Unity Digital Clock | Unity Tutorial


In this video tutorial, we'll guide you through the process of creating a digital clock using Unity. You'll learn how to set up a real time clock, design a user-friendly interface, and implement scripts to display the current time.



WATCH FULL TUTORIAL ON YOUTUBE


CHECK OUR PROJECTS


SUBSCRIBE FOR LATEST OFFERS



=========================================================


Unity Projects - ON SALE!!!


1. Water Sort Puzzle 9000 Levels

https://payhip.com/b/cjDb8


2. Ball Sort Puzzle 9000 Levels

https://payhip.com/b/IbtoD


3. Sling Shot

https://payhip.com/b/PjLDH



=========================================================



Script:


DigitalClock.cs


using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.UI;


public class DigitalClock : MonoBehaviour

{

  public Text clockText;

   

   

  // Start is called before the first frame update

  void Start()

  {

    StartCoroutine(UpdateClock());

  }


  IEnumerator UpdateClock()

  {

    while (true)

    {

      System.DateTime now = System.DateTime.Now;

      clockText.text = now.ToString("hh:mm:ss tt");

      yield return new WaitForSeconds(1);

    }

  }

}





DOWNLOAD CODESTER FILES