|
Hello, I'm creating a FPS game, and I've got the basics done. I'm wondering how I can use a manager in the scene to keep track of a players K/D, headshots, and score with one script for something like multiplayer. I have a script on the character that keeps track of K/D, headshots, and score, but it gets deleted with the character when they die, and everything gets reset(I want the character to get deleted). I want to store and continually update these stats for every player in one script so I can re-update them on the character when they respawn. How could I do this?
(comments are locked)
|

Put that script on another GameObject, then? One that doesn't get destroyed when the player dies.
I can't because the character that gets killed by the player sends a message to the weapon used, which then sends a message upwards to the manager to record the kill and other info. I don't really want to use a different method because the one I currently use works perfectly. I need something that could store the player's stats in a class or something, update them, and set those variables back when the player dies.