Which bullet shooting sync mechanism to use

Options
hello,
When synching the bullets should I use rpc calls to instantiate them or is using photonnetwork.instantiate also fine

Comments

  • Rivax95
    Options
    Hi @roycefernandes3
    It depends on many factors, there is no clear answer, it depends on the approach of your code. In my case I generate projectile instances or I do it through object poling, the fact of generating istancias can mean an unnecessary consumption of cpu, on the other hand if the projectiles are not absolutely visible (rocket for example) I would do it by raycasting and synchronize the damage by an rpc.

    I hope my answer is useful to you
  • Thanks @Rivax95
  • S_Oliver
    Options
    Since bullets travel at a high speed, its not a good idea to try to sync the position. Just send an rpc with enough information to create the bullet on all clients. Handle the damage that will be applied only on the owner.
  • Thanks for clearing my doubt @S_Oliver . The explanation was insightful!