Hi @JohnTube
I change the audio source configurations using the following codes and try to shrink the voice distance to 1 meter in the virtual world:
private void OnEnable()
{
speaker = target as Speaker;
audioSource = speaker.GetComponent();
audioSource.rolloffMode = AudioRolloffMode.Linear;
audioSource.maxDistance = 1;
audioSource.minDistance = 0;
audioSource.spread = 0;
audioSource.dopplerLevel = 0;
playDelayMsSp = serializedObject.FindProperty("PlayDelayMs");
}
Questions 1:
I found that the audio source configurations is not transferred to photon server, and restore this configurations in the clone prefab,, the locally Instantiate prefab and the clone prefab all use the same default values?Is that right?So I can change the above codes and let all the Instantiate prefabs use the same conf values.
Question2 ::
there are two persons in the virtual world whose audio source max distance are all 1, the effect I want to get is when one person is out of another person's audio source scope, they cannot hear each other.But now the result is we can hear each other, only the volume is smaller and smaller when our distance is further and further.When the distance is reach to 30-40, we can not hear other.So what's wrong with my codes?Or How can I reach the effect??
Thanks.