Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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:
    2,068
    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. ProtoPottyGames

    ProtoPottyGames

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