Hey folks, im kinda new to this scripting thing, ive been reading around and i think im starting to get how the things work, however ive been having some problems.
Right now im trying to make a cool main menu for my game and i wrote the following script:
var startsound : AudioClip;
var endless : AudioClip;
function update(){
start();}
function start(){
audio.PlayOneShot(startsound);
Camera.main.SendMessage("fadeIn");
if(!audio.isPlaying){
audio.clip=endless;
audio.Play();
}
}
What i want it to do is to play sound A once, fade in and when sound A stops it should play sound B wich will be a loop. That script goes attached to the main camera who has two audio sources and a audio listener as it should.
The real problem here is that no sound gets played, when i hit play it just does the fade in. Im obviously missing something here but i really can´t find what it is.
Anyone would have a hint for me?