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.

Reporting a Unity 4.6.3 issue

0 votes
Since I updated to Unity 4.6.3, setting AkAmbient events to be performed upon "Destroy" simply fails. If I call the events from code, all is fine (so the issue is not with the Wwise project file),

but stopping a sound from the Unity editor with an AkAmbient component now fails. I'd also like to point out that so far this always worked.


Is there a compatibility issue between Unity 4.6.3 and the latest Wwise build?
asked Mar 4, 2015 in General Discussion by Ede T. (170 points)
edited Mar 4, 2015 by Ede T.

2 Answers

0 votes
Since there was no reply to this yet and the issue still persists, I did additional testing and thought I'd provide some more details.

I have a play sound loop event and a stop sound loop event (environmental sound effect). What I normally do is I place a Unity GameObject and add two AkAmbient components to it.

One of the components plays at "Start" and plays the loop. The second component happens upon "Destroy" and stops the loop. Since Unity 4.6.3, this doesn't work. It did work before.

It's also worth noting that doing the same from code (calling the stop event from OnDestroy) still works. It's just the GameObject approach that doesn't work anymore.

I also get an error message when the GameObject is destroyed. Unfortunately the error message is just the following: "!IsDestroying()" . That's it. If I double-click that error message, AkSoundEngine_Windows.cs opens and the line "in_gameObjectID.AddComponent<AkGameObj>();" is marked as the reason for that error (in the last PostEvent method overload).


I hope this helps and this issue can be resolved soon.
answered Mar 15, 2015 by Ede T. (170 points)
Sorry about the delay on that. I took a look at this issue, and there is indeed a problem with the script execution order. During initialization, we need to register the AkGameObj before posting any events, etc., so in the script execution order, AkGameObj is put quite early.

However, during the destroy flow, the reverse is true: we need the AkGameObj to do the actions, but AkGameObj runs before the other scripts, and so it is unregistered when we get to them.

A fix will be available in the next Unity integration, which should be coming out soon.
Though this issue is now gone, Wwise randomly crashes the Unity editor and the exported game as well. (I'm not alone in this, others have reported it as well.) Also, the "!IsDestroying()" error message is still displayed for every sound stopped this way (and it still points to the same line I described above).
0 votes
Best answer
After a bit of back and forth, the problem was narrowed down to a corner case with posting events from the OnDestroy function. A fix will be available in the next integration.
answered Mar 25, 2015 by Benoit S. (Audiokinetic) (16,020 points)