I am pulling my hair out trying to figure this out. I honestly can’y believe UE4 has PlayerCharacter, PlayerController, PlayerState, GameState, GameMode and GameInstance. Multiplayer over network is the most confusing thing I’ve ever done as a programmer, mainly because I feel the mechanics in play are so outdated and could definitely be streamlined.
Anyway, frustration aside, I am trying to figure out PlayerCharacter, PlayerController and PlayerState for use in an MMORPG. I finally figured out how to use Sessions. I store my player’s name in GameInstance so it persists through levels. Now I have two main issues:
- I am trying to use a simple TextRender attached to my PlayerCharacter to display names over the players. No matter what I do, players’ names are always the current player’s name. So player ‘A’ logs in. Then player ‘B’ logs in. On player 'A’s screen, player 'B’s name is ‘A’. On player 'B’s screen, player 'A’s name is ‘B’. If I add a third player, it’s the same deal. How do I make these unique to the player and show that on everyone’s screens.
- I am trying to get my player’s target’s PlayerState. It looks like all of my PlayerCharacters are using the same PlayerState. When I print the PlayerID from player state, they all have the same PlayerState. What am I missing here? PlayerState seems to make absolutely no sense to me.
I guess a more general question is: Where do I store my player’s stats such as Health, Mana, Strength, etc? I’ve tried PlayerState, but this seems to be shared among all my players.
I’ve also scoured this website for all things are similar, and none make complete sense.