Online Multiplayer Template

You're viewing a single comment in a conversation. View all the comments
  • 2 Comments

  • Order by
    • Hello! Its bit hard to say without seeing your code or at least an example of your game and how you are handling collisions at the moment. You could try something like this:

      - give your player object instance variable called PeerId

      - when player is created set PeerId instance variable to Peer object multiplayer.MyId

      - make instance variable called PlayerId or something to bullet object

      - when your player spawns the bullet assign bullet`s instance variable to Peer.PeerId

      all the previous events are used to identify which player shot the bullet. Then you have to check id when collision happens. -> Bullet of collision with Peer, Peer.PeerId ≠ Bullet.PlayerId -> damage Peer.

      This way you should be able to damage only players that did not shoot that particular bullet.

      Hope it helps!