Hello
I hope you guys can help me with a sound problem of mine.
I have a Spotlight on which I have a script attached, and two Audio sources ( two different sounds).
In the script there I have written two similiar If statements.
Part of the code below.
if ( fval == 1000){
count = true;
}
if (count){
if (x == 10 ){
audio.Play();
}
(And the other sounds should play when the fval has another value in its own If statement.)
It plays the first added sound just fine with audio.Play();
But How do I declare the other sounds in the If statement that follows.
The sound that plays fine first is for example named “crash” and the other I want to be played is named “hit”
Ive tried to look at the API but I cant figure it out. Ive tried declaring the sounds with something like "var crash: AudioClip; But that didnt really do it.
How do I declare the other sounds and tell the audio,Play which sound to play ?
Scripting really isnt my field.
I hope Iam making myself clear.
Thanks in advance ![]()