To play a sound once during Update() use a boolean variable or instantiate a GameObject with an AudioSource with the same settings.
function Start() {soundplayed = false;
}
function Update ()
{
if (!soundplayed)
{
audio.PlayOneShot(blast);
soundplayed = true;
}
... }
No comments:
Post a Comment