Is there a way to trigger events using the audio listener?

Well I’ve already asked this on answers, but it is taking a while to get it approved apparently so here we go:

Basically, I want to change various aspects of the player depending on the volume of the sound around them. Is there a way to have the audio listener to do it automatically? Or is there a way to manually have each audio source do this when the player comes into range?

I’ve tried attaching a script to the player that causes the changes whenever the audio source is playing anything. This works semi well but I really don’t know how to have an event trigger when a player walks within an audio range beyond setting up a trigger collider. Thank you in advance.

The audio listener has no properties and AFAIK you can’t access it inside the script but I don’t think that’s what you want anyway. The audio source has no idea where the player is unless you add a trigger or collider. I would try attaching box collider to the audio source and then use OnCollisionEnter() the access the player gameObject’s collision properties.

You can’t really use anything on AudioListener for this, but you’re probably on the right track with what you’re already doing with the AudioSources.

I would try getting more detailed information out of the AudioSource to get better feedback to use. You may be able to use a Mixer and/or volume around the player or something, but I’m not sure if it exposes what you need.