TextMesh.text Manual     Reference     Scripting  
Scripting > Runtime Classes > TextMesh
TextMesh.text

var text : string

Description

The text that is displayed.

See Also: text mesh component.

JavaScripts
// Set the text of the attached Text mesh
GetComponent(TextMesh).text = "Hello World";

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
GetComponent<TextMesh>().text = "Hello World";
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
GetComponent[of TextMesh]().text = 'Hello World'