The idea of it that i want to slowly subdivide tempScore and add score for a second then do it very fast… there was another algorithm that used Time.time, but it didnt work, too!
I’ve not tested this script yet, but it should do what you want. In order to add some value to the score, just store the value to add in tempScore: the score will rise in a slow pace and after reach the time defined in slowTime it will go up 1 per frame
private var lastScore:int =-1;
private var nextTime:float;
private var slowTime:float;
function Update(){
if (tempScore>0){
if (tempScore>lastScore){
lastScore = tempScore;
nextTime = Time.time;
slowTime = nextTime+2; // slow for 2 seconds
}
if (Time.time>=nextTime){
scoreNumberTxt.text=score+"";
tempTxt.text="+"+tempScore;
if (Time.time<slowTime)
nextTime += 0.5; // slow pace
else
nextTime += 0.001; // fast pace
tempScore--;
lastScore = tempScore;
score++;
}
}