I’m trying to be able to add songs into a game item (in this case the camera).
Here’s my code
public AudioClip[] songs;
int currentSong = 0;
void Update (){
if (audio.isPlaying == false) {
currentSong++;
if (currentSong >= songs.Length){
currentSong = 0;
audio.clip = songs[currentSong];
audio.Play();
}
}
}
However, when I try to access the array, the script connected to the camera has nothing I can add to put songs in.