Replication Of Widget Variables To Clients

I have just started to implement networking into my game, and I have hit a major issue. None of my variables seem to be showing up on the client’s Widget HUDs. When I run the game as the server, the screen looks like it should:

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_125074_1513292544206_360”}[/ATTACH]

However, when I run it as a client, none of the values from my gamemode blueprint are showing up:

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_125075_1513292554675_294”}[/ATTACH]

For example, the timer is set up to subtract 1 every second in my game mode blueprint, and it is referenced in the widget blueprint like so:

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_125076_1513292449969_897”}[/ATTACH]

and the replication settings on my time variable in the game mode blueprint look like this:

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“data-tempid”:“temp_125077_1513292460283_427”}[/ATTACH]

And I get this error message:

Blueprint Runtime Error: Accessed None trying to read property CallFunc_Create_ReturnValue from function: ‘ExecuteUbergraph_ShoterPlayerController’ from node (Add to Viewport) in graph (EventGraph) in Object: (ShooterPlayerController) with description: Accessed None trying to read property CallFunc_Create_ReturnValue

And I also get a couple more errors with very similar wording.

Sorry if this felt like an image dump or something but I’ve been racking my brain about this for ages, looked around in the internet and I couldn’t find anything. It may be useful to note that I have created my widgets in custom events in the Player Controller and they are based in the Client. Then I run them in the game mode blueprint. Thanks for any help :slight_smile:

You might want to look a bit deeper into GameState and PlayerState. The UE4 documentation is not that bad when it gets to the point why these should be used for replication and when. (Bottom of this article:)

https://docs.unrealengine.com/latest…work/GameMode/

Thanks for the help, I tried moving everything from game mode to game state, and it worked!. Problem is, each client seems to be having their own stats in the game even though the stats are stored in the game state. For example, If I score a basket on client 1, the score increases on their screen but stays at 0 for client 2. It should be the same across all screens. And another minor issue is that when I start the game, the intro stuff happens (the countdowns and intro cutscene, but then the game just restarts and plays it all again, then plays normally from there on out. It is quite odd, but I’ll try to fix these issues. Thanks for the help though, I managed to sort out the biggest problem because of it :slight_smile:

Edit: Well, I just came across a major issue :confused: . When i shoot the ball with client 1, it doesn’t move on client 2. Similarly, if I shoot with client 2, the ball doesn’t move on client 1. I’ve tried changing replication for the ball actor, the shooting and the variables, but nothing worked.