|
Hello everyone! I recently got Unity 3.5 and I'm having an error everytime I try to play an AudioSource. The sound is a 2D sound and is in a prefab. Upon activating the sound I get the error(warning); "Can not play a disabled audio source". However the sound still plays perfectly. Any ideas? Can I disable the warning? EDIT: Here's the snip'it of code with the audio Thanks!
(comments are locked)
|
|
Try adding calls to Debug.Log next to the code that a) plays the sound, and b) enables the audio source. Maybe they aren't occurring in the order you think they are. An interesting other issue is when you destroy the object. ie have an object that makes a sound when destroyed but if you destroy the object the sound doesnt play. ( I know it sounds obvious but not so when see the code)
Apr 30 '12 at 10:29 PM
Fabkins
(comments are locked)
|

How about not playing a disabled audio source? Just enable it.
I went ahead and tried that, no luck. I used "reloadSound.enabled = true;" and reload sound being the AudioSource variable.
Do you have to use an audio source? Try using an audio clip?
Sorry for being late to respond, yes I need to use an Audiosource.