Hello, I’m trying to create a counting effect on unity, There is my code
#pragma strict
static var Score : int = 0;
var fakescore : int = 0;
var scoreboard : GameObject;
function Update () {
if (scoreboard.active)
{
fakescore += 1;
}
if (gameObject.active)
{
var t : TextMesh = scoreboard.GetComponent(TextMesh);
t.text = fakescore.ToString();
gameObject.GetComponent("Timer (Script)").active = false;
if ( fakescore > Score){
t.text = Score.ToString();
}
}
}
so, I want to do this;
If fakescore equals Score, Set TextMesh to “Score.ToString();” but code didn’t worked So can anyone help me ?