Please be advised that the Audiokinetic offices will close at 3:00 p.m. EST on December 23rd, 2019 for the holiday period, and will reopen on January 3rd, 2020 at 9:00 a.m. EST. Learn more.

Community Q&A

Where Wwise users help each other out!

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

Unity - "The name AKSoundEngine does not exist in the current context"

0 votes
Hi,

I've already had success integrating Wwise in Unity 5, however, when I try to call an event directly from a script, say the footsteps script in the FPS character controller and I try to call "AKSoundEngine.PostEvent("Footsteps", gameObject); " on every step cycle, I get an error mesage in Unity's console saying "The name AKSoundEngine does not exist in the current context". I've tried to call a gunshot event too from a weapon script and I got the same error. Other events work fine when I drag them from the wwise picker onto a game object but calling an event directly from a script is the problem. What am I missing here?

Thanks!
asked Mar 20, 2016 in General Discussion by RobR (140 points)

1 Answer

0 votes
 
Best answer

Hello Rob, there is a typo in your call, you need to use AkSoundEngine and not AKSoundEngine.

C# is case sensitive, explaining why in your case Unity does not recognize AKSoundEngine.

You can work around this by using the auto-complete feature of your IDE.

Hope this helps !

answered Apr 2, 2016 by Fabien B. (Audiokinetic) (12,240 points)
selected Apr 6, 2016 by Benoit S. (Audiokinetic)
Thank you Fabien. Yes I actually noticed the typo and corrected it but I also finally understood what was the problem. The FPS character controller script does not recgonize Ak calls because it is one of the standard unity assets. As soon as I moved the entire FPS folder up one level it worked. Thanks for the answer!
Have the same Problem with AkSoundEngine. It just wont find it. on the FPSControllerScript. Using autocomplete on the IDE wont help.
You saved me Rob, thanks!!
...