I’m trying to have an audio file play when it’s destroyed but its not working.
Here is my code.
I have the audioclip set up here.
public AudioClip deathSound;
And here is the code that has the audio file in.
switch(other.tag)
{
case "EnemyProjectile":
audio.PlayOneShot(deathSound);
Instantiate(Explosion, transform.position, Quaternion.identity);
Destroy(other.gameObject);
GameManager.PlayerDies();
Destroy(gameObject);
break;