hello, I want to play the sound.
but, there is a error can not play a disabled audio source.
how can i fix it?
this is a my script.
private var destTime : float;
function Start () {
destTime = 3.0;
}
function Update () {
destTime-=Time.deltaTime;
if(destTime<=0.0)
{
Destroy(gameObject);
}
}
function OnTriggerEnter(other : Collider)
{
if(other.gameObject.FindWithTag("Ball"))
{
gameObject.audio.volume = 100;
gameObject.audio.Play();
other.gameObject.FindWithTag("Refree").SendMessage("TimePlus",5);
Destroy(gameObject);
}
}
what’s wrong whit this script?
i have no idea about this.
please teach it to me.