Hello,
I’ve just started Unity so I’m new to this.
I have GUI Text on the screen that is a component of GameObject. I’m using a script component that Auto types the text.
I’d like it so that after the text has finished typing, the text (so I’m guessing GameObject) is hidden?
This is my script for Auto type
var letterPause = 0.2;
var sound : AudioClip;
private var word;
function Start () {
word = GetComponent.<GUIText>().text;
GetComponent.<GUIText>().text = "";
TypeText ();
}
function TypeText () {
for (var letter in word.ToCharArray()) {
GetComponent.<GUIText>().text += letter;
if (sound)
GetComponent.<AudioSource>().PlayOneShot (sound);
yield WaitForSeconds (letterPause);
}
}
Thanks