I’m working on a multiplayer shooter, and so far I can count deaths. My shooting is projectile based, so the player receives damage when a bullet collides with him, and dies when his health runs out. However I’m not sure how to count the kills. How would the player know that one of his bullets killed another player?
I figured the bullet should have a reference to the player that shot it, but I’m not sure isLocalPlayer would be useful in this instance. Is there a alternative way to identify each player. Maybe I could use that.
Are all the players called the same thing e.g “Player (Clone)”?
For the moment yes. I’m not saying they should be, maybe that’s the problem, i just need to know how to go about it.
ok would say research a script to set unique player names and then I would say create a game manager gameobject and add a script that has a intiger and when the bullet hits something it will do
Gameobject.Find("GameManager").GetComponent<GameManager>().Hits++;
//OR if you have a function that does it
Gameobject.Find("GameManager").GetComponent<GameManager>().AddHit();
that would add up the kills and you could have a string that contained the player names