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

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?

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,380 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!!
Hello, I am struggling with the same error, what do you mean by moving up the entire fps folder?
Hi! I got the same error. Somebody can explain to me, what it means moving up the entire fps folder?