The role of the PlayerState?

Hello, i’m making a multiplayer shooter game.

I have a Character, a PlayerState and a Weapon class.

The Weapon takes off Health from the player in the game.

But, should I put the KillCounter variable in the PlayerState or in the Character?

Should I add a Kill to the player from the PlayerState or from the Character?

In the ShooterExample Character, I don’t see any reference to the PlayerState class.
PlayerState class gets never taken into account.

Help me!

From the wiki “PlayerState containing replicated information about the player using this controller (only exists for players, not NPCs).”

PlayerState is for stuff that should not be destroyed with the player.
EDIT: the KillCounter variable should be in the PlayerState and then you should add a kill to the KillCounter var through your character

-CrazyToby

Sorry, in the topic I meant KILLS and DEATHS, not health!

That is most suitable for the PlayerState, as that needs to be active through the whole game. :slight_smile:

Yes, but in the ShooterGame there’s not any function like AddKill() in the PlayerState class… so that brings me to think I shouldn’t make a function like that in the PlayerState. Or maybe I should make it in the Character and then access the PlayerState in there.

I don’t know…

It’s your choice to decide if you want to make the function in your character or PlayerState :slight_smile: I’m pretty sure ShooterGame has no kill counter implemented, but it’s a long time since i last used it so i can’t really remember

Should I perform Authority checks in the PlayerState? In the ShooterGame there aren’t. So are they necessary?