This question was
closed Jul 05, 2017 at 04:42 PM by
Dismantler69 for the following reason:
I fixed it on my own
Question by
Dismantler69 · Jul 05, 2017 at 01:57 PM ·
arrayaudiosource
Manipulating an AudioSource array
public void Audio (){
music.volume = volumesliders[0].value;
sfx[0 - sfx.Length-1].volume = volumesliders[1].value; //NOT FINISHED YET!!!
}
Note: The sign in the square braces is a hyphen. So this is a simple script to control the volume of several audio sources through one slider. When I build the script, I get no errors, but once I try to move the slider in-game, I get an 'out of range index' error. What am I doing wrong?
Comment