- Home /
Bullet Collision in Networking Game.
I am making a multi-player shooter game using Photon.I am trying to solve how I can shoot from one cannon and let every player on in the game see the cannon shot and see if the shot collide/hit another player.
I have a Cannon object that has a Shooting script. On mouse click I send RPC to all players that they should fire from position X and with rotation Y in the forward direction. This seems to work okay and I am able to fire the cannon with one player and other player sees the bullet over the network. The Fire function (inside the Shooting script) instantiate a bullet object and add some force to it.
So, how can I know if the bullet hit a player? The bullet has a script where I use the OnTriggerEnter() function to log that the object hit something. But I probably want to send RPC to everyone that this bullet hit a player, so every one could decrease his health in the game. Is there any way to keep track of the collision inside the cannon object so the cannon can send a RPC to other players about collision of the bullet?
Your answer
Follow this Question
Related Questions
Photon shot collision 1 Answer
[Solved]Shoot a projectile towards a target location. 3 Answers
Multiplayer projectiles collision 0 Answers