Hi guys, I’m quite new here. I’ve always been more of a modeller/designer but am taking the plunge into programming and scripting which I am loving. I’m using JavaScript by the way.
I’m working my way through the Stealth tutorial series and have come across something that I don’t understand. He makes a reference to the panic alarm music like this:
private var panicAudio : AudioSource; // Reference to the AudioSource of the panic msuic.
Which to my knowledge is just declaring a new variable of type AudioSource. (?)
He later implements the variable:
// ... and fade in the panic music.
panicAudio.volume = Mathf.Lerp(panicAudio.volume, 0.8f, musicFadeSpeed * Time.deltaTime);
but I don’t see anything that’s linking the actual AudioSource of the child Game Object, which is called secondaryMusic.
What am I not understanding?
Here’s the link: The Lesson and Code
Thanks so much guys, looking forward to your wisdom!
Your link is out, can you update it ?
– KiraSenseiIn the C# code, line 30 initializes panicAudio.
– robertbu