I use
function ScreamSFX()
{
if(SanityEffect.currentSanity >= 20)
{
GetComponent.<AudioSource>().clip = BreathingCalm;
}
if(SanityEffect.currentSanity >= 40)
{
GetComponent.<AudioSource>().clip = BreathingLow;
}
if(SanityEffect.currentSanity >= 60)
{
GetComponent.<AudioSource>().clip = BreathingHigh;
}
if(SanityEffect.currentSanity >= 80)
{
GetComponent.<AudioSource>().clip = BreathingCry;
}
}
to insert my sounds, and I declared them as AudioClip variables on top. I call ScreamSFX in the Update() function, but the sound never plays. Can anyone tell me why? Thanks!