For the Multiplayer game where i store player health?

for the Multiplayer game where i store player health?

  • game instance
  • character
  • player state
  • player controller
    which one is better and useful for performance and other things?

I have been following this…

…thus, I have my player health on my character/pawn.

I believe game instance is incorrect. The player state seems to be used for shared data between all clients. The player controller exist while the client is connected which may not be what you want.


Typical is the actual player Pawn, which has the benefit of already having some support built-into the engine. Add a variable for “health” and adjust it as appropriate in the “receive damage” type events/callbacks. Make sure it replicates.

A second spot that might work is PlayerState, which is a good place for general player-specific data (such as score and such,) but if you support, say, choosing different heroes, and the hitpoints change when you do, then health is more a property of the pawn than the player. Also, if you have damage rendering like more bloodied, walks with a limp, etc, then the pawn really needs this to be able to present itself correctly.

1 Like