Basic Projectile Callback Question

Options
I am using an RPC that creates a local projectile for every player, the only parameter sent over the network is the angle. When the owner of this projectile sees a collision I would like to destroy the projectile for all other players, as well as the owner. Does this mean I need to add a PhotonView to every projectile I create, or can I still use local projectiles and somehow make a networked call to find and destroy that projectile?

Best Answer

  • DarkJoltGames
    DarkJoltGames ✭✭
    Answer ✓
    Options
    Using a photonView on each and every projectile is not bad. You should avoid using unnecessary RPCs, and instead stick to using PhotonNetwork.Instantiate to instantiate projectiles with their own photon views, and a nice, clean PhotonNetwork.Destroy to clean them up. However, under no circumstance should you synchronize the position or rotation, as that would generate too much data. Anyway, moral of the story is, fussing with non networked objects as important as projectiles is a bad idea, just keep important objects networked, and just don't sent too much data.

Answers

  • DarkJoltGames
    DarkJoltGames ✭✭
    Answer ✓
    Options
    Using a photonView on each and every projectile is not bad. You should avoid using unnecessary RPCs, and instead stick to using PhotonNetwork.Instantiate to instantiate projectiles with their own photon views, and a nice, clean PhotonNetwork.Destroy to clean them up. However, under no circumstance should you synchronize the position or rotation, as that would generate too much data. Anyway, moral of the story is, fussing with non networked objects as important as projectiles is a bad idea, just keep important objects networked, and just don't sent too much data.