Download

Networking Question

After following the networking tutorial https://www.youtube.com/watch?v=htdI2dh-aek I added a new variable “player name” and I’m a bit confused about why my players custom name only is displayed to players if playing as server, when I play as a client I’m able to see the name change for myself however it does not update on other players screens.

d877767e33fffa6cc3d2056a30c9060478c4ee55.jpeg

47389475df0d9cd8bee8a549d196fe3cc0ca0cdd.jpeg462bb57e3ac851c6232b58de34b2d0e42174d337.jpeg

This is UMG widget that displays text field to update player name variable,
d44ef4fe1ef9262fca32224102bd9365ed0f82d6.jpeg

This updates character text
529b5bc7bc9381dc482157ed44746f8522b96519.jpeg

Player name has to be replicated and it has to be set by the server to replicate to the clients. I run an event “on client” from the controller to load the player name from my instance/player save and then call an event “from server” in the same class to set my replicated variable on my character, which I cast to and check with switch has authority. It took me forever to figure that out but it works. If only we could modify the Player Name value from PlayerState in blueprint :stuck_out_tongue:

That worked perfectly thank you for your help! I’m now much closer to creating a multiplayer game!

370efede4a9d35a55c476ce305b3f8ad936efec7.jpeg