AudioMixer Snapshot Problem

Hello!

I’m doing a multiplayer game and I wonder how I can make the following effect:

I was thinking of doing different snapshots, audio Mixer, and with a script to do that when the audiolistener is located at a certain distance to change the snapshot on the other, I tried that but I can't get it.

I hope soon to be fixed
thank you
sorry if my English is bad.

Hi @Xpadrian2010 ,

Try AudioMixer.TransitionToSnapshots and use the distance to determine weights. Here is part of the code to do a similar thing using points in space (nodes) that are associated with a snapshot.

for (int i = 0; i < node_array.Length; i++) {
			closenesses *= 1/*

Vector3.Distance(node_array*.transform.position,
_
target.transform.position);*_

public void BlendSnapshots()
* {*
* mixer.TransitionToSnapshots (snapshot_array, distances_to_nodes_array, 0.005f);
_
}*_
This weights the transition based on irregularly spaced nodes. For your problem you would either want to have only 2 snapshots (very close and very far) and blend between them, or figure out a way to set your weights based on specific intervals of distance from the source (if it’s in 5 meter intervals, maybe testing if distance%5==0). Hope this helps.