I've set up a simple achievement structure in my game, basically if the player gets 10 scoring objects without taking any damage they get a "ten in a row" achievement.
I've got it coded so the achievement icon comes up as a GUITexture and it plays a sound with the following code:
guiTexture.enabled = false;
var Tada : AudioClip;
private var played: boolean = false;
function Update () {
if(scorer.scorz == 10 && LifeScript.life == 5 && !played)
{
played=true;
audio.clip = Tada;
audio.Play();
}
}
What I would like to do and have so far failed at (I'm still in the early learning stages of Javascipt), is have it then disappear after 10 or so seconds so it didn't stay on the screen.
I know the answer is probably really simple, so I apologize for asking a newbie question, but all help is greatly appreciated.