public Text textObject; // To Assign in inspector textObject = gameObject.GetComponent<Text>(); // Only use if text is on same // object as the script, and remove public from "textObject" textObject.text = "Hello, World!";