- Home /
int to string for a HUD guitext
hi there, i am trying to make the HUD show me how many points i allready got while playing... my problem: i can't get my gui text to show me the content of the var -.-
thanks for your help!
here is my script:
var asl = punkte_Sammeln.PUNKTE;
function Update () { var ptt = ToString(asl);
guiText.text = ptt;
}
Answer by Bunny83 · Feb 28, 2011 at 09:18 PM
Quite simple. In .Net/Mono every object have a built in function .ToString(). You can do this:
var asl = punkte_Sammeln.PUNKTE;
function Update () { var ptt = asl.ToString(); // or what would work too: // var ptt = "" + asl; guiText.text = ptt; }
Viel glueck ;)
Your answer
![](https://koobas.hobune.stream/wayback/20220613110713im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Convert int to string 2 Answers
Download a WWW int? Or convert? 1 Answer
Converting to string 1 Answer
Convert Int to String? 1 Answer
ByteArray impossible to convert... ? 1 Answer