So I have this really weird thing that my audio doesn't play when "Play on awake is unticked" but it does play when it is ticked.
I have sought for a solution for a long time but couldn't find an answer to my question.
So basically the setting is a space game. When you get hit by an asteroid the script attatched to the asteroid calls a PlayHitSound() function that plays the sound. But as stated above, the sound only plays when "Play on awake" is ticked, which I don't want.
Any help would be appreciated!
Edit: I actually used some breakpoints to see if the code even reached the PlayHitSound() function but it does. It reaches and executes the soundfile.Play() function but somehow when "Play on awake" is unticked it doesn't play the sound
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Sound files not working [Unity 5.1]
Unity Crashes on Startup - Sound Driver Issue? DxDiag Provided
Load Google Play Popup during Unity startup on Android?
My projects don't open!
A* pathfinding generating new path when created new obstacle