Sound Identifier Unknown?

I’m making a audio clip to play whenever you get “scared” in the game I am creating. I am using

if (SanityEffect.currentSanity >= 20)
{
      mBlur.enabled = true;
      mBlur.blurAmount = 0.2f;
      GetComponent.<AudioSource>().clip = BreathingCalm;
}

to call the effects and the sound. I repeat this for a few more lines, replacing 20 with 40, 60 and so forth. The sound changes every time the value changes. I am getting an ‘Unknown Identifier’ error, with BreathingCalm (my sound file) as the error. I set variables up top using

var BreathingCalm : AudioClip;

for every sound file I had. Anyone tell me why it is giving me this error? Thanks guys!

Too difficult to tell with just these snippets. Showing your whole code file plus the exact console error message would help.

GetComponent shouldn’t have a “.” after it.

1 Like

Good catch.

Good Catch x2, I tried all my previous fixes with this and it functioned with one of them. Thank you!