Why will my audio not play in if statement?

I have looked around and cannot seem to find anyone with a similar problem, and I have tried many different ways to get my audio to play. I have a sphere that destroys when it is hit with another sphere using onCollisionEnter. That part works fine. Where i’m having issues is getting my audio clip to play when this happens. I have made one of the spheres an audio source, currently do not have the clip stored in the clip attribute of the audio source. I can get the clip to play by calling audio.PlayOneShot() in the Start() function, but not in my onCollisionEnter. Here is my C# code.

void OnCollisionEnter(Collision collision) {
		if(collision.gameObject.tag == "Dart") {
			audio.PlayOneShot(Pop, 1f);
			Destroy(collision.gameObject);
			Destroy(gameObject);
		}

Any help is greatly appreciated,
Corey

You may want to destroy the object after you play the sound. So a simple solution would be a coroutine

IEnumerator Kill(float time)
{
   yield return new WaitForSeconds(time);
   Destroy(gameObject); 
} 

this is a simple sample. You can look at the reference page here.

void OnCollisionEnter(Collision collision) {
       if(collision.gameObject.tag == "Dart") {
         audio.PlayOneShot(Pop, 1f);
         Destroy(collision.gameObject);
         StartCoroutine("Kill", 1f);  
       }

It won’t play the audio because you are destroying the object before it plays. Try to play the audio from an object that won’t be destroyed, like an audioController or something like that.