UE4 Multiplayer how to replicate Player name in lobby

I’ve been working on a little 1V1 snipper project to try and get a better grip on the replication and the game framework of unreal engine.

So after the core gameplay, I’m trying to make a lobby system. I’ve been able to make the player join together without any issues, but I struggle a little bit with the replication. I’m trying to show the player’s name over their pawn in the lobby, and I can’t get it to work. In the client, both their name doesn’t get replicated, and in the server, only the server name appear:

And I get this error from the server logs

[2020.01.21-00.45.03:318][906]PIE: Error: Only Local Player Controllers can be assigned 
 to widgets. 
 BP_PlayerLobbyController_C_1 is not a Local Player Controller.

So I get that something is wrong with accessing the 2nd player controller from bluprint like this

But I don’t know how to make it work other wise. I’ve set the PlayerName widget to replicated, but it doesn’t seem to work.

Any idea on how I could get this to work?

First of all widgets don’t run on servers and in online multiplayer only local player controllers are accessable to client, you need to move anything that need replciation to everyone in playercontroller to playerstate insted and make widget read data from playerstate.

Also UE4 already have player name support and if you use any online subsystem it will honor specific service display name, you should use that. It also part of player state

Indeed, everything Shawdowriver said. I use PlayerState to update all my client-side widgets, because although clients are NOT aware of other Clients’ playercontrollers, they ARE able to see their Playerstates and any variables replicated on them, including the built-in name.

There is node in BP to change the name of the player