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.

0 votes

Hi there,

I recently upgraded to the latest Wwise Unity integration, most things seem to working well, but as soon as the game loads in to the main first level (after a hub area) all the audio on the main character stops working and I get the Error:

Wwise: Unknown game object ID. Make sure the game object is registered before using it

This was all working fine before I updated the integration. 

I have seen other posts on here about this error, but most seem to be in reference to deleting objects, whereas we are just disabling, loading the next scene, and re-enabling the gameobject.

Anyone have a workaround?

 

Thanks

 
in General Discussion by Ralph C. (270 points)

2 Answers

0 votes
This should be fixed in 2015.1.1.  Did you install that version?
by Mathieu J. (Audiokinetic) (7.1k points)
yes, it's the latest integration, as I said
Any other info for us? It would be much appreciated.
I just tried to reproduce this without success. Here's what I did:
1- Create scene "1.unity" with a Cube and a Sphere.
2- Add an AkAmbient and an AkBank to the Cube, set to play on start
3- Create scene "2.unity" with a Capsule
4- Add an AkAmbient and an AkBank to the Capsule, set to play on start
5- Write a script that sets DontDestroyOnLoad to true on a GameObject, and attach it to the Cube and the Sphere in scene 1.
6- Write a script that calls SetActive(false) on the Cube and then loads scene 2, in the OnMouseDown function. Attach it to the sphere.

Now, when I preview the game in the Editor, I hear my first sound. When I click the Sphere, the Cube disappears, but its sound continues to play. The capsule appears, and its associated sound begins. No error messages are printed in the console.

Is this similar to what you are doing?
Hi,

No our whole game runs in one scene, what is happening is:

1. The game loads, I'm loading a bank with the general sounds in them.
2. The Game Starts, our characters sound is perfectly fine
3. When the user walks into an area to go to the first level:
   a) He is disabled
   b) The level geometry is loaded in
   c) The Soundbank for the level is loaded in
   d) He is re-enabled
4. I get the error I mentioned above and none of the characters sounds work any more.

There is no difference in how this all works apart from the new plugin installation
Any ideas for me? Thanks
This is strange... This use case should be covered by the bug fix in 2015.1.1 Mathieu mentioned.

Have you tried connecting the profiler to your game? In the Game Object Profiler layout (F12), you should see all registered game objects, and their registration time. You can compare this to the time at which the event was posted, in the Profiler layout (F6). This should help you debug when the game object is registered vs the time the event is posted, and why it says "Unknown game object ID"
Hi Benoit,

Thanks for the comment. I have looked at the game object profiler layout and I can see that the object I am talking about is unregistered when it gets disabled.

This is quite strange, as the main character is made up of two distinct segments (body and Head), and they are both disabled by the parent GO when the new section is being loaded in. They are both disabled in the exact same way. Yet in the Wwise game Object profiler the head is shown to be unregistered, but the body is not.

So the bodys audio works fine, but the heads throws the error.

I did also notice that the head isn't reacting to the Environment Area (there is a rigidbody attached to the head before you ask :P)

Seems like the bug has crept back in.
0 votes
 
Best answer
OK, so I finally figured out what was causing this, although I still feel it is a bug.

Because of an error in our code the head was getting disabled in code twice (although the body was too - see the comments below if you want to see the whole process - but somehow it was OK?).

Wwise did not seem to like this, and after the second disable message in Unity decided that the Object should be unregistered.

I'm still not sure why this only happened to the head and not the body, although the head had a lot more going on just before it is disabled so maybe some of these calls were causing Wwise to think that it had been destroyed rather than disabled.

 

Thanks for the help all!
by Ralph C. (270 points)
After reading this post, I have found a possible bug that has been introduced in the latest version when GameObjects are disabled.

Thanks for reporting this, I will work on a fix ASAP!
...