x


Count down on gameobject

Hi,

What i want to do is have a timer that attached to a gameObject for a invinceable count down. This timer will be placed on top of the gameobject for the user to see it count down.

Is there any way that the count down number from a script can be attached in this way?

Thanks

more ▼

asked Sep 16 '10 at 01:34 PM

Mark 6 gravatar image

Mark 6
58 7 7 12

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

A simple way to count down is using yield, for example :

vat timer : int = 10;

function Start(){
  CountDown();

}
function CountDown(){
  while (timer >= 0){
    yield WaitForSeconds(1);
    timer--;
  }
}
more ▼

answered Sep 16 '10 at 03:00 PM

AliAzin gravatar image

AliAzin
2.6k 43 56 79

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2176
x356
x66

asked: Sep 16 '10 at 01:34 PM

Seen: 1489 times

Last Updated: Sep 16 '10 at 01:34 PM