Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

No Audio when Reloading script assemblies Unity

0 votes
I have worked with Wwise in Unity for a bit and every time I make a change in a script, Unity Realoads script assemblies and after that, no sound is playing when starting the game. But active events queues up and playes all of them when exit playmode.
I did some digging and found out that "ms_Instance" in AkInitializer.cs is null. The Awake function that sets "ms_Instance = this" is only calles when exiting playmode and when starting up Unity. (I guess since it has "[UnityEngine.ExecuteInEditMode]"). It works fince as long as I dont change code and restarting the game fixes the problem as well.
Though restarting the game to hear sound every time I change the code is pretty anoying.

I solved it by adding

if (ms_Instance == null)


if (ms_Instance == this)

inside "OnEnable". But I think that I probably did something wrong for this to happen I shouldnt have to fix it this way. No clue though.
asked Dec 3, 2021 in General Discussion by Jonas N. (100 points)

Please sign-in or register to answer this question.