function OnCollisionEnter(col : Collision)
{
if(col.gameObject.name == “Cube(Clone)” && !activeDig)
{
digSound.Play();
if(col.gameObject.GetComponent(materials).curTxt == 1){
activeDig = true;
score += 100;
yield WaitForSeconds (2 / drillSpeed + 0.2);
}
Destroy(col.gameObject);
activeDig = false;
}
}
can you please tell me why does the digSound keep playing until the end , when collided with Cube(clone). After 2 seconds I destroy it and then they are not on collision anymore, but sound keeps playing.