Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

How do I detect which sounds are entering the AkEnvironment?

+1 vote

This is a question posted on social media and continued here to benefit those not on social media. 

Here's a suggestion for a script that detects what sounds are entering the AkEnvironment's trigger. 


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CheckTriggerInteractions : MonoBehaviour
{
     private void OnTriggerEnter(Collider other)
     {

          if (other.GetComponent<AkGameObj>() != null) {
               print(other.gameObject.name+" entered "+gameObject.name+"'s trigger.");
          }
     }

     private void OnTriggerExit(Collider other)
     {

          if (other.GetComponent<AkGameObj>() != null)
          {

               print(other.gameObject.name + " exited " + gameObject.name + "'s trigger.");
          }
     }
}


Should be copied and pasted into a new script on the AkEnvironment game object.

asked Jan 11, 2021 in General Discussion by Mads Maretty S. (Audiokinetic) (38,280 points)
edited Jan 12, 2021 by Mads Maretty S. (Audiokinetic)

Please sign-in or register to answer this question.

...