I have no idea how its called but I want to add a nicer score counter. I have a variable called “score” now every goodie that is won is simply adding lets say 50 to the score instantaneously. Now what I want is that it is adding that 50 slowly to the score so it looks like is counting up within a second or two. I’m looking for a long time to find a tutorial on this but cant find one.
Sorry I forgot to tell its in javascript. So I add the scores from my goodies to count? This is then translating to score? right? just trying to understand this
function Do (int count)
{
for(int i = 0;i < count; i++)
{
score++;
yield WaitForSeconds (1/count);
}
}
What you do is call the function, with the amount you want to add to the score. It then runs in the loop adding one to the score each time the loops run, the loop uses waitforseconds which “stops” the function for an amount of time and then runs again.