2

Trying to call a RPC from another class. But seems like It doesn't work. How can I fix this?

Using 3 RPC in same function. So I tried to call function without RPC in a RPC function(This RPC in same class so it works flawlessly) but it doesn't work either I suppose.

chambers[i].Bullet.Fire(muzzle);// Without RPC code:

photonView.RPC("chambers["+i+"].Bullet.Fire", RpcTarget.All, new object[] { muzzle });// With RPC

Made a Debug log in Fire function. So when it works I should see it. But when I press the button I get this log(By the way i dont get this in other RPC calls).

Sending RPC "chambers[0].Bullet.Fire" to target: All or player:.
Esamy
  • 35
  • 2
  • 5

1 Answers1

2

Add photon view to the bullet, and call Fire directly on it.

chambers[i].Bullet.photonView.RPC("Fire", RpcTarget.All, new object[] { muzzle });
Iggy
  • 4,767
  • 5
  • 23
  • 34