I have 3 audio sources on my lantern object, each one has the different sound in, and then i have my script file which is below. When i turn the lantern on it only plays the burning sound and not the SoundTurnOn as well?
var soundTurnOn : AudioClip;
var soundTurnOff : AudioClip;
var burning : AudioClip;
var toggle : System.Boolean;
function Start() {
audio.clip = burning;
audio.Play();
}
function Update() {
if (Input.GetKeyDown(KeyCode.F)) {
toggle = !toggle;
if (toggle)
{
audio.clip = soundTurnOff;
audio.Play();
}
else
{
burningfunction ();
}
}
}
function burningfunction () {
audio.clip = soundTurnOn;
audio.Play();
audio.clip = burning;
audio.Play();
}