Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

0 votes
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
in General Discussion by Arnaud B. (310 points)

1 Answer

0 votes

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

by Benoit S. (Audiokinetic) (16.0k points)
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
...