Paused event doesn't always start when resuming in build

Hi! Another problem that only seem to occur in builds. In the game we have a main theme that plays over and over. Sometimes the player can enter a challenge. When that happens another song is played, I then set the main theme to paused, and start to play the challenge theme.

If the player cancels the challenge the reverse should happen: the challenge theme stops and the main theme gets unpaused. This always work in the editor but sometimes in builds the main theme doesn’t get resumed, but the challenge theme stops as expected, so no music will be heard after that.

At first I thought this was because of me instantiating the events over and over again and I had also built a kinda komplex wrapper around everything. But now I have changed to a more simplified version and the error still persist. If I debug the result is always “OK” when the track resumes.

I have no clue what could be the cause of this. Below is a link to important part of my AudioManager script (look for comment 1 and 2)

https://codeshare.io/ardn0Y

If more code or profiling session is needed, let me know I can send them. Thanks in advance!

Nothing in your code stands out as a cause of this issue.

Have you tried recording a profiler session to see exactly what the main theme does.
You should be able to see it in the lifetimes view, and also the order of the calls in the API capture.

Hi Cameron! Thanks for the reply, this was indirectly solved by another issue. Turns out I had many instances of an event that shouldn’t play which slowed down performance making some events not loading correctly.