Search Unity

Third Party Wrong Death? Photon

Discussion in 'Multiplayer' started by dick, Jun 21, 2015.

  1. dick

    dick

    Joined:
    Sep 6, 2014
    Posts:
    91
    Ok, I have damage and health system set up using rpc's. Player 1 kills player 2 right? When he does that, Player 2 dies AND responds like he's supposed to. Now, at the same time, Player 1 ALSO respawns into Player 2 character. So now in the scene, we have the original Player 1, Player 2 that has been respawned, and Another Player 2 character that is controlled by player 1. Also, when I deleted that extra player from unity editor, everything seemed to work fine and there are now only two players in the scene. Until Player 1 kills Player 2 again. So I believe that Player 1 ALSO goes through Player 2 respawn process, yet Player 1 doesn't get destroyed, only Player 2 does. Someone please help and tell me why. I feel this may be a simple code logic error, but not sure.
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    I usually add logging to code that could be related in case my logic doesn't work. Unity always gives you a full call-stack, so you can find the call path per log entry and that helps. Often it's just some code you didn't expect to be called.

    With this description, it's impossible to help more in detail.
     
  3. dick

    dick

    Joined:
    Sep 6, 2014
    Posts:
    91
    Thanks, I already fixed this issue, BTW how do I like close this thread ? Or delete it, or mark as answered or something
     
  4. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    77
    I am having this same issue, any chance you could explain what you did to fix it?