Hello I have a sound effect working perfectly for the main player because a tutorial I just watched but I tried to do the same thing for an enemy & it does not work I put the sound to play under OnTriggerEnter2D idk what’s wrong
public AudioSource Sound;
void Start ()
{
Player = GetObject.Find(“Player”);
Sound = GetComponent<AudioSource>();
}
void OnTriggerEnter2D(Collider2D col)
{
if ((col.tag == “Player” || (col.tag == “Bullet”))
{
Sound.Play ();
Destroy(GameObject);
}