So I want to change the text in a TextMesh on the fly, but I can’t get the component TextMesh. The error is "‘text’ is not a member of ‘Object’. "
Here’s my code.
#pragma strict
var Player : GameObject;
var DisplayText;
function Start () {
DisplayText = gameObject.GetComponent(TextMesh);
}
function Update () {
DisplayText.Text = "Placeholder";
}