0

I have Audio Source. On certain events, the sound is played through the function:

[PunRPC] private void PlaySound() {

   GetComponent<AudioSource>().PlayOneShot(shootSound);

}

And then this function is called via

photonView.RPC(nameof(PlaySound), RpcTarget.AllBufferedViaServer);

And here's the problem: If you use this method, then the sound will be played simultaneously for all players, throughout the game map, but it needs to be played at a certain distance.

If you use this function without RPC, then everything seems to work, but then this sound is not synchronized.

In the sound settings, I made the minimum distance 1, and the maximum 20.

I need the sound to be synchronized, but only spread over a certain area

  • Did you also set the `Spatial Blend` of the audio source to fully 3D? Otherwise the distance doesn't have any effect – derHugo Feb 19 '23 at 17:00

0 Answers0