Hello.
I am fairly new to scripting within Unity and need help with making a sound loop whilst the player is walking within a trigger event. The script below make the audio play the clip once but for some reason doesn’t wish to loop the audio when I try adding in a timer event. Any help would be greatly appreciated. Many thanks
#pragma strict
var splashClip:AudioClip;
var issplash = false;
function OnTriggerEnter(o:Collider)
{
issplash = false;
if(issplash == false)
{
playsplash();
}
}
function playsplash ()
{
audio.PlayOneShot(splashClip);
}