- Home /
Audio wont play/stop in standalone mode, but works in editor
I have these two lines of code that are either not executed or just doesn't do anything:
GameObject.Find("Music").audio.Stop();
GameObject.Find("Explode").audio.Play();
So what happens is after the player has won the level, the music is stopped and the enemy explodes (and an explosion sound is played). This totally works fine in the editor in play mode, but in standalone .exe these two lines don't do anything. The music keeps playing and the explosion sound never plays.
Any idea why it wouldn't work in standalone?
Your answer
Follow this Question
Related Questions
UnityWebRequestMultimedia.GetAudioClip dont't work in WebGL build (2019.3.15f1). 1 Answer
How can I stop the variable values reverting to its default values after being built? 1 Answer
Using a PC to create a build for Mac OS X 5 Answers
Mac Standalone build immediately crashes 0 Answers
Unity standalone build triggers McAfee malware detection 0 Answers