Update Gui Text with Score

in the script below, it changes the guitext the next time the level is loaded, but can someone help me update the text when the score is updated.

here is the script

var Counter : int = 0;


function addscore () {
      Counter++;

      guiText.text = ""+Counter; 
      if (Counter > 100){
      guiText.anchor = TextAnchor.UpperRight;
      guiText.pixelOffset = Vector2 (100,351);
}
}

function endlevel (){
    guiText.text = "0";
    Counter = 0;
}

thanks in advance

ps, if there is a link to something that can help me can you post it please, thanks :slight_smile:

guiText.text = counter.ToString();

I don’t get it… Are you calling “addscore” function every time player scores a point and score isn’t updated?

guiText.text = ""+Counter;  and  guiText.text = Counter.ToString(); should work the same

addScore isn’t startLevel!

Of course you can write guiText.text = Counter.ToString(); in Update or OnGUI function, but your code should work too… Just please let us know where you will call your addscore funcion :wink: