I’m trying to get a collect sound to play when a coin is collected. When the collect sound is in the coin prefab, the sound doesn’t play, but when the collect sound is outside of the coin prefab, it does. but having the sound outside of the prefab means that I have to set the sound in every individuals coin. Any suggestions as to how I can get the audio to play with the audio source in the prefab? Here’s my code:
public AudioSource audioSource;
public AudioClip collect;
public float vol = 1;
void OnTriggerEnter(Collider other)
{
ScoringSystem.theScore += 1;
Destroy(gameObject);
audioSource.PlayOneShot(collect, vol);
}

