I have a script attached to a prefab that, in a function, calls an audio clip using:
audio.PlayOneShot (clip);
The audio clip is referenced in the public field in the inspector. I’ve done this many times before and never had any issue with it. But for some reason, when the function runs, I get no audio and a warning in the console that says “Can not play a disabled audio source”. The audio source is enabled and there is no other code anywhere in the script that could possibly be disabling it.
Interestingly, if I try to play it from the start method it works fine. But if I move it anywhere else in the script after the start method, no matter where, it doesn’t work and I get this warning message.
I also have another nearly identical prefab in the scene playing audio in the exact same fashion, and it works fine.