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.

+2 votes

I'm having some trouble with posting a Wwise event to Global Scope from Unity.
I'm using Unity 2022.3.5 and Wwise Integration 2022.1.6.8263.2826.

IIRC, doing something like:

  • AkSoundEngine.PostEvent("Test", null);

With "null" as the in_gameObjectID parameter should post the event to Global Scope.
But I just tested this on a new Unity 2022 project, and this isn't working anymore.

This issue contradicts the following info from the Wwise docs (API Changes and Limitations)
https://www.audiokinetic.com/en/library/edge/?source=Unity&id=pg_limitations.html

  • PostEvent() and GameObject-related APIs now accept null as the GameObject input argument to affect the global scope.

If I set a Unity GameObject on the in_gameObjectID parameter, the event plays correctly.
But if I set the parameter to null, the following errors appear in the Unity console:

Wwise: Invalid parameter in_GameObj in function call AK::SoundEngine::RegisterGameObj
UnityEngine.Debug:LogError (object)
AkCallbackManager:PostCallbacks () (at Assets/Wwise/API/Runtime/Handwritten/Common/AkCallbackManager.cs:392)
AkSoundEngineController:LateUpdate () (at Assets/Wwise/MonoBehaviour/Runtime/AkSoundEngineController.cs:81)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
Wwise: Unknown/Dead game object ID used in function PostEvent. Make sure the game object is registered before using it and do not use it once it was unregistered. Name: 3157003241
UnityEngine.Debug:LogError (object)
AkCallbackManager:PostCallbacks () (at Assets/Wwise/API/Runtime/Handwritten/Common/AkCallbackManager.cs:392)
AkSoundEngineController:LateUpdate () (at Assets/Wwise/MonoBehaviour/Runtime/AkSoundEngineController.cs:81)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
Wwise: Invalid parameter in_GameObj in function call AK::SoundEngine::UnregisterGameObj
UnityEngine.Debug:LogError (object)
AkCallbackManager:PostCallbacks () (at Assets/Wwise/API/Runtime/Handwritten/Common/AkCallbackManager.cs:392)
AkSoundEngineController:LateUpdate () (at Assets/Wwise/MonoBehaviour/Runtime/AkSoundEngineController.cs:81)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

Potentially related issue:
https://www.audiokinetic.com/qa/11403/getglobalvalue-not-working-unity-2021-wwise-2022-8100-2644

in General Discussion by Andrei M. (720 points)

Please sign-in or register to answer this question.

...