社区问答

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

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

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

0 投票
Hello audiophiles

When I drag my switch event onto a game object in unity, as well as the AKSwitch script, and play the game the error "No Valid Switch" comes up.

Can anyone explain this to me, is it something I'm not doing in Unity, or is it something that I've missed in the Wwise program ?

 

Thanks!

 

Arnaud
分类:General Discussion | 用户: Arnaud B. (310 分)

1个回答

0 投票

In Wwise, Make sure your Switch Container is assigned to a switch group:

  • In the Property Editor for your Switch Container, under "Switch Type", assign a switch group, and a default Switch/State
  • In the Contents Editor, assign children to Switches (under "Assigned Objects")
  • Re-generate your SoundBanks

For more information on Switches, you can refer to the Wwise help (In Wwise Authoring: Help > Wwise Help), under Wwise Help > Using Sounds and Motion to Enhance Gameplay > Defining Object Playback Behaviors > Defining the Contents and Behavior of Switch Containers

用户: Benoit S. (Audiokinetic) (16.0k 分)
I've done exactly that and I still get the error.
I've tried with various projects in Wwwise and in Unity. Can't seem to get past this error... Any other ideas?

Thanks for the help Benoit!
Here is a bit of the process I would you to verify things on the way to the game.

Verify Sound Object Assigned for Switch Type: Switch in Actor Mixer.
Verify (correct) Switch Container added as an Event Action to Event.
Verify Event has been included in the Soundbank.
Verify Events/ Structures for the Switch Container/ Event that the Switch
-Make sure all Structures are included.
-Make sure all Media is included.
Verify the Soundbank is getting updated with your changes.
Verify the Soundbank is being loaded by your Unity Project.
-Must exist in correct location within (Streaming Assets)
-Run Game in Unity Editor, Connect Wwise, Profile F6 (Soundbanks Tab).
Verify Event can be triggered while connected.
-Do other switches work?
-If you add a sound to the Event with no switch, does it work?
-What are the errors in the Profiler?
How is the AKSwitch being executed by Unity? (in code, OnStart, OnAwake, etc)

You're almost there, keep at it!
-lcl
Hi Damian

Thanks a lot for help. I went through everything you mentioned and the switches work now!
There were a few things I was doing wrong, using the profiler in Wwise is extremely helpful.
The sounds were actually working when just played in the events, it's the switches that were causing a problem. Somehow I wasn't using them correctly and they weren't compiled in the right way either.
Anyway. All good now. Got a beautiful footstep switch now and will definitely use switches for other sounds as well. They're great!

Even though everything is working fine now, I am wondering if I am doing it the mist efficient way. As I'm sure there must be a few different ways to get these switches to work.
I currently have 2 AKSwitchs on my floor collider:
1- OnTriggerEnter + tag.player + keydownW, that triggers a Walk switch.

2- Update, that triggers a Surface_Snow switch on Update.

I then have the AKEvent that containes the footstep switch on the floor collider, that triggers when I enter the collider.

Is this correct?

Thanks a lot again!

Arnaud
...