|
When I load a prefab, it doesn't load the audio source that is connected to it, so it doesn't play when I want it too. Also, on a slightly related note, when I use Audio.play() in a script, it plays every single audio source attached to an object/prefab in the scene/assets. Help please? Thanks in advance.
(comments are locked)
|
|
Well, regarding the Audio.play() try audio.PlayOneShot(NameOfWhatYouWantToPlay).
(comments are locked)
|
|
Regarding the first problem - make sure you added an AudioSource component to the prefab that contains AudioClip member with the linked asset (that's what got me...)
(comments are locked)
|

When I instantiate a prefab with an audio source component it loads fine and the audio plays. How are you loading your prefab?
I have this: var explode : AudioClip; in the code, and then I drag and drop the file I want (which is in wav format) into the slot on the inspector.