I am having problems with audio.PlayOneShot and I don't know why this isn't working.

if(col.gameObject.tag == “Destruction”) {
if(col.gameObject.name == “Spike”){
contact = col.contacts[0];
audio.PlayOneShot(audio2);
print(“test”);
}
else if(col.gameObject.name == “Laser”){
contact = col.contacts[0];
audio.PlayOneShot(audio3);
print(“test2”);
}

		referenceSpawn.kill();
	}

can anyone tell me why this isn’t playing the audio even though the test messages are being printed? I have the audio clips attached via the inspector, so as far as I know everything is how it is supposed to be.

Simple for play audio follow this it will be clear for you

public AudioSource source;
public AudioClip[] clips;
void Start()
{
    source.PlayOneShot(clips[0]);
}