- Home /
A fancier method to add numbers
Hey guys I'm trying to think of a method that does a fancier addition or subtraction to your score.
I like the look of the current score doing a fast count up to whatever addition number that is added to it.
So if you had a score of say, 75 and you added 25 to that number, insead of instantly popping to 100, it would scroll through the numbers 76-100 fast in order to "get" to 100. I've tried a few google searches to help get started but nothing seems to be coming up that's even close to what I'm trying to find. Even though I'm sure it has to be out there.
Anyone know of any tutorial, or script I could look at?
Answer by The Kracken · Dec 02, 2013 at 09:39 PM
Look at http://docs.unity3d.com/Documentation/ScriptReference/Mathf.Lerp.html
here is some sudo code
float start = 75;
float finalscore = start + 25;
score = (int)Mathf.Lerp(start,finalscore,time);
Thanks! This is exactly the direction I needed to be pointed too!
Your answer
Follow this Question
Related Questions
Scoring System 1 Answer
Score not properly updating when enemies are destroyed - javascript 4 Answers
Highscoring and changing scripts (Java/UnityScript) 1 Answer
Why am I getting a negative score? 2 Answers
Adding scores/numbers? 1 Answer