Game Mode
Game State
Player State
Player Controller
Pawn
HUD/Widgets
Game Mode
Game State
Player State
Player Controller
Health Variable
Character Overlay Widget
Health Bar
Now in this game project, we’re going to add a health variable on the character class. Now, you may be wondering why we don’t add the health variable to the player state as player state contains the current state for the player. Well, our player state can keep track of things like score and defeats, but when it comes to the health, we’d like to update our health rapidly and the player state has a slower net update than the character itself. So there will be a delay when we change the health on the server that we would have to wait until we see that change on the client version of the player state. Whereas our character can handle our damage events and do this rapidly because it has a faster replication rate.