var timer:float;
var timerOn:boolean;
var explosion:GameObject;
//sound
var explodeSound:AudioClip;
function Start()
{
timerOn = true;
timer =0.0;
}
function Update ()
{
if(timerOn==true)
{
timer += Time.deltaTime;
if(timer>=5.0)
{
audio.PlayOneShot(explodeSound);
for(i=0;i<25;i++)
{
Instantiate(explosion,gameObject.transform.position,
gameObject.transform.rotation);
}
Destroy(gameObject);
}
}
}
unity doesnt give me any error msg but the sound doesnt play when it should ![]()
(i attached the sound already , my object is prefab )
help me plss thx