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.

No Valid Switch Error in Unity when using PostEvent

0 votes

I am using a box collider to trigger an event that is being emitted from a separate game object. The event is to play a Switch container, so I also attached AkSwitch to the game object. To play the event I am using my own script:

void OnTriggerEnter (Collider col) 
if (col.tag == "Player")
GameObject go = GameObject.FindWithTag ("NPC");
go.GetComponent<splineMove> ().StartMove ();
AkSoundEngine.PostEvent ("tempVoicePlay", go);
I am getting a "No Valid Switch" error when running into the trigger. I know the banks and events are solid because it works when assigning AkEvent to the object instead (which doesn't work for me because the sound emitter is then the box instead of the NPC). Also, this script works when I change the event in Wwise to instead play a Random container. Is there something else I need to add to the script to make it recognize that the switch is indeed valid?
asked Dec 10, 2014 in General Discussion by Drew B. (100 points)

1 Answer

0 votes
answered Dec 10, 2014 by Benoit S. (Audiokinetic) (15,960 points)