Wwise and custom triggers

In case you are using the Wwise plugin in Unity, here is a tip I'm writing down for myself so I don't have to figure this out again.

If you want to make a custom trigger:

  1. subclass AkTriggerBase:
public class TriggerBlah : AkTriggerBase {
  public void Play() {
    if (triggerDelegate != null){
      triggerDelegate(null);
    }
  }
}
  1. add the trigger component you just made on any AkAmbient GameObject it's supposed to trigger

  2. call

GetComponent<TriggerBlah>().Play()

when you want to trigger the sound.

That's all folks.

Show Comments