Search Unity

Countdown

Discussion in 'Scripting' started by robertseadog, Aug 18, 2005.

  1. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    I just wondered how you can use Unity's time to make say a countdown timer, so that when the times up something happens..?
    Thanks
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    You can have a timeLeft property, and then subtract time.deltaTime inside Update

    To display it, you can either scale an object (for a bar), or use a textmesh...
     
  3. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Of course! I know about deltaTime and I know update! Why don't my brain function anymore? I need some air..

    Thanks though!
     
  4. robertseadog

    robertseadog

    Joined:
    Jul 23, 2005
    Posts:
    374
    Ok, I've had my walk; Im better now..

    So how do I get to change the text parameter in textMesh? Just:

    Code (csharp):
    1. MytextmeshName.text = "blabla"; //??
     
unityunity