Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Wrong Death? Photon

Discussion in 'Connected Games' started by dick, Jun 21, 2015.

  1. dick

    dick

    Joined:
    Sep 6, 2014
    Posts:
    77
    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:
    1,951
    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:
    77
    Thanks, I already fixed this issue, BTW how do I like close this thread ? Or delete it, or mark as answered or something
     
  4. jimthegrim

    jimthegrim

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