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