Change the content of a Text Mesh

Hi there

I have a 3d text gameObject and i want the Text Mesch to
display a vareable.

Simple Question: How do i do this?

My script:

var number=0;
var text=“0”;

function Update () {

number=PlayerPrefs.GetInt(“points”);

text=number.ToString;

//Display the vareable “text”

}

I have no idea since i tried everyrhing…

Thanks for your attention =)

I think you need to use this:

GetComponent(TextMesh).text = text;

Is your script on the same game oject as the script?