Hi all,
I’m learning UE’s multiplayer logic and have created a custom PlayerState to store player’s health.
The player state itself works normally, but when I try to create a UI for displaying the health, I ran into a strange issue:
For a P2P situation(i.e. play as listen server), the host player can get the player state normally, but the client player can’t.
If I change the net mode to Play As Client. All the player’s will not be able to get the proper player state.
After debugging, it seems that the player state I got is “Unknown” for same reason:
I also tried the “GetPlayerState” from the player controller, but I got the same error.
I can confirm the custom player state works because breakpoints set in C++ are triggering normally, and the health value for players are correct.
Does anyone know what’s wrong? Am I using the wrong way for getting the player state? Or Did I missed some settings somewhere?
Thanks in advance



