Referencing player state for scoreboard variables?

Hi there. I’m trying to have it so when a player joins a multiplayer session, the joining player gets their steam info with the advanced sessions plugin and sets it on their own player state:

Then, a custom event is called for everyone that gets all player controller classes and for each loop it gets some variables that are stored on the player controller and the two variables that were set on the player state in the previous picture and calls a custom event that runs on the client:

The custom event that runs on the client determines how to add the player to the scoreboard. So if spectating is true, it adds the name to an array which is the spectator list. If OnRedTeam or OnBlueTeam is true, it will create a widget and add it to the corresponding list:

Everything works except for 2 things:

The name is always the server hosts name for everyone on the scoreboard. So If my name steam name is “Bryan” and I am the host, everyone’s name will be “Bryan”. I need it to properly reference the clients own player state so it can set their name on the scoreboard as their correct steam name and set it on the scoreboard.

The second problem is that clients do not load the player avatar variable at all. It is left blank. It doesn’t even get the servers variable. I need it to properly reference the clients own player state for their player avatar variable and set it on the scoreboard.

While it is currently being tested on listen servers, it will eventually be tested on dedicated servers and need to work on them.

Does anyone know what I’m doing wrong and how to fix it? I’ve been trying to get this to work for so long. Any help would be appreciated.

Hi @blastertoad I asked you about this a couple of months ago, and you helped me out. I thought the problem was fixed from following your advice, but I could not get it to work. Do you think you could take a look at this again and tell me if you have any idea how to fix these issues? It would be appreciated :slight_smile:

I would suggest saving all your vars on the PlayerState as it is available to all clients, where as controllers are only on server and owning client. Also it looks like you are setting PlayerState Vars on client on begin play. On your game mode do a function override for on player join, and grab the player controller pin off that to set all your vars on server side when client joins.

BTW hello again old friend. If you want to talk it through you can always hit me up on my discord server. You can find a link on my youtube channel ToadNet.