- Home /
AudioSource.play not working unless assigning AudioSource.clip again in my script
I have added an AudioSource component on my GameObject, and dragged an AudioClip onto AudioSource's inspector/panel, then GetComponent().Play() in my script. However it won't play anything.
The solution is assigning GetComponent().clip = anyAudioClip again in my script before playing it. But it doesn't make sense right? Then what it the meaning of assigning it on the inspector? Does AudioSource component be reset before game runs?
Answer by SandipVala · Apr 08, 2016 at 07:03 AM
Check AudioSource settings Audio Source
also check your scene have at least one audioListener !!
Your answer
Follow this Question
Related Questions
Loading Audio from Asset Bundles not working in Unity 5.2 2 Answers
Play a random audio clip when button is clicked 3 Answers
How to record audio in chunks and send through websocket? 0 Answers
Reading Wav file from a folder 0 Answers
AudioClips automatically fastforwarding at beginning of scenes 0 Answers