Hello I’m having a hard time getting a object that’s getting destroyed to play an explosion sound. I’ve tried multiple ways to get it to play but it doesn’t play the audio comes up as mono idk if that matters it’s also under a OnTriggerEnter2D idk if that would make a difference, their are other sounds playing in the background & when the player shoots… idk what I’m doing wrong
public GameObject Explosion;
public GameObject Player;
public float Speed;
public AudioSource explosionSound;
void Start () {
Player = GameObject.Find(“Player”)
explosionSound = GetComponent<AudioSource>();
}
void OnTriggerEnter2D(Collider2D col)
{
if ((col.tag == “Player”) || (col.tag == “Bullet”))
{
explosionSound.Play();
PlayExplosion();
Destroy(gameObject);
}