NullReferenceException When Attempting To Play AudioClips

OK, basically, I was working on this

[1]. All of the AudioClips and Texture2Ds are set in the editor, I checked. Everything is working perfectly smoothly except for lines 261 and 270, which are:

    BackgroundAudio.clip = CurrentTrack;


    VoiceAudio.clip = CurrentVoice;

Whenever those lines are called, I get a NullReferenceException. [Here's][2] the test file I'm having the program read for this.

I don't quite see what I'm doing wrong, since the Texture2Ds all appear perfectly fine.


Your last comment says you declared them in start. That would be your problem.

You need to declare them global and then assign them in start or drag the sound in inspector.

If you do it all in start I guess it gets destroyed on completion of the function.