Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

How can I locally play audio over a network without rapid RPC calls?

$
0
0
I'm currently working on a FPS game. I had audio working quite well on single player for my rifle (fires about every .1 second), but then I started using RPC calls for other players to hear the audio as well. This caused a terrible stutter in the audio, and reduced the quality greatly. Is there a way I could have the players locally determine the shots and play them at the shooting player's point? I want to try to avoid calling excessive amounts of RPCs, to avoid the bandwidth and lag issues. My code Currently: GetComponent().RPC("Fire", PhotonTargets.Others, gunAudioClip, transform.position); //(called every .1 seconds) [RPC] public void Fire(int gunAudio, Vector3 position) { AudioSource.PlayClipAtPoint(AudioClips[gunAudio], position); }

Viewing all articles
Browse latest Browse all 592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>