menu
 

Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+2 votes

[Relating to WWISE in Unity]

Let's say you want to trigger a sound effect when a Unity gameobject is destroyed (e.g. item explodes or is collected).

As I understand it when you call AkSoundEngine.PostEvent, "At runtime, an AkGameObj component is automatically added to this GameObject", but if I Destroy the Unity GameObject after posting the event, I get the error:

Wwise: Unknown game object ID. Make sure the game object is registered before using it and do not use it once it was unregistered.(Object: [myobjectname] (UnityEngine.GameObject))

 

Seems like a very common scenario - is there a recommended way to handle this case?

 

in General Discussion by Chris (690 points)
I've tried a couple workarounds for this too,  these also seemed to give a console warning:

--- #1 - Create a new object just to play the sound whilst deleting the originating object ---
I created a new component for these OneShot sounds: I then play a sound via that component (and delete the originating game object) - I did this via a PostEvent with a callback that was called when the Event ended. In that callback, I delete the OneShot object.

--- #2 - Unregister before deleting the object ---
I post the event and then immediately unregister the game object with the sound engine.
Quick update: I hear that this is resolved in the very soon to be released WWISE 2014.1.6 and 2015.1

1 Answer

0 votes
 
Best answer
For me, this appears to be fixed in the recently released WWISE 2015.1 - seem to be able to Destroy() objects without generating any warnings
by Chris (690 points)
...