社区问答

欢迎来到 Audiokinetic 社区问答论坛。在此,Wwise 和 Strata 用户可互帮互助。如需我们团队直接提供协助,请前往技术支持申请单页面。若要报告问题,请在 Audiokinetic Launcher 中选择“报告错误”选项(注意,问答论坛并不会接收错误报告)。我们内部设有专门的错误报告系统,会有专人查看报告并设法解决问题。

要想尽快得到满意的解答,请在提问时注意以下几点:

  • 描述尽量具体:比如,想达到什么样的目的,或者具体哪里有问题。
  • 包含关键细节:比如,Wwise 和游戏引擎版本以及所用操作系统等等。
  • 阐明所做努力:阐明自己为了排除故障都采取了哪些措施。
  • 聚焦问题本身:聚焦于问题本身的相关技术细节,以便别人可以快速找到解决方案。

0 投票
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!
分类:General Discussion | 用户: RobR (180 分)

1个回答

0 投票
 
已采纳

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 !

用户: Noemie P. (Audiokinetic) (12.9k 分)
采纳于 用户: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 !
...