How would you network a rocket projectile?

I already have. But what I did was just make a RPC call to spawn the weapons moving rocket projectile on all players client-side through a RPC, not Photon.Instantiate. This isn't going to work for me because

The latency is like 180ms on the cloud at the moment so the real rocket is 180ms ahead of the other players rockets and they need be able to dodge the rocket. I also know that you aren't supposed to Photon.Instantiate projectiles because you would run out of photon views very quickly. Could I allocate about 20 photon views to always be re-used, somehow. So if 15 rockets are shot at once by 15 players they each have a set photon view but then that gets recycled somehow?

How should I go about doing this. Please show an example of what I can do also. Thanks.

Comments

  • Hi,

    It is better to use RPC in this case. Check the time when RPC was called and adjust the weapon's position on a remote client according to the time elapsed.

    See Photon Unity Networking Intro:

    PhotonMessageInfo() contains a timestamp property which can be used for getting the time when the RPC was called.