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,

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!
in General Discussion by RobR (180 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 !

by Fabien B. (Audiokinetic) (12.9k points)
selected 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?
Hey, this moving the entire folder fix also worked for me.
In unity project window there's a folder in Assets->Standard Assets->Characters->FirstPersonCharacter
Just grab the FirstPersonCharacter folder and drop it in the root folder called Assets, that should fix it
That work For me Thanks a lot !
...