Hi, I'm developing a car combat game, and there are players, and defense towers on each team.
Each player has a photonview, and so do the towers (towers aren't spawned though, they are already in the scene).
I deal damage through an RPC, and if the hit enemy dies, it adds to the other players score using PhotonMessageInfo (info.sender.AddScore(1);).
That works fine, the problem is, when a tower kills an enemy, it adds score to the player that got killed. So if I get killed by the tower, it adds 1 to my score, but if another player gets killed by the same tower, it counts one point for them.
How should I proceed to stop this from happening? I tried getting info.photonview.name, but it returns the player object, and not the tower.
Each player has a photonview, and so do the towers (towers aren't spawned though, they are already in the scene).
I deal damage through an RPC, and if the hit enemy dies, it adds to the other players score using PhotonMessageInfo (info.sender.AddScore(1);).
That works fine, the problem is, when a tower kills an enemy, it adds score to the player that got killed. So if I get killed by the tower, it adds 1 to my score, but if another player gets killed by the same tower, it counts one point for them.
How should I proceed to stop this from happening? I tried getting info.photonview.name, but it returns the player object, and not the tower.