- Home /
Question by
reBrent · May 25, 2014 at 10:38 AM ·
guiobjectfunction updateappear
How do I make GUI text disappear after a set amount of time?
Is there anyway i can make my GUI text disappear after an amount of time?
#pragma strict
var inZone : boolean = false;
var found : AudioClip;
var hasPlayed : boolean = false;
var theGuiObject : GUIText;
var timer : float = 10.0;
function Update() {
if(inZone == true)
{
if(hasPlayed == false)
{
hasPlayed = true;
audio.PlayOneShot(found);
theGuiObject.enabled = true;
}
}
else
{
hasPlayed = false;
theGuiObject.enabled = false;
}
}
Thanks :)
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613145836im_/https://answers.unity.com/themes/thub/images/avi.jpg)