Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party (Photon) Proplems with taking damage

Discussion in 'Multiplayer' started by Menzle, May 19, 2020.

  1. Menzle

    Menzle

    Joined:
    Apr 11, 2020
    Posts:
    3
    So I'm making a multiplayer game with photon, and i've set a script from wich you can take damage and die.
    But when I test it, the player who shot takes damage, not the one who got shot.
    So what's happening is that the script, that is attached to the player prefab gets called whenever I shoot, but it also gets called on the player prefab who shot.
    And I don't know how to solve this.
    I would appreciate if you could give me some answers.
    here are my scripts :
    the "Wind" script is the gun script and the "playerEnemy script is health"
    Let me know if you awnt screenshots or the playermovement script or something like that.
     

    Attached Files: