Hi, I have basically followed the Merry Fragmas FPS tutorials on Unity and now I want to add sound when shots are fired.
I have tried creating an RPC method that accepts the AudioSource of the other player to play the bullet sound but I just found out that the parameters for RPC calls can only be int, string, float, bool or vectors.
[RPC]
void ShotFired(AudioSource AS1)
{
AS1.Play();
}
Which is called when the player (I) fire a bullet
void Start ()
{
PV = GetComponent<PhotonView>();
AS = GetComponent<AudioSource>();
}
void Update()
{
if(Input.GetButtonDown("Fire1"))
PV.RPC("ShotFired", PhotonTargets.All, AS);
}
How do I do this ?
Thanks