Get a Timer widget to show on multiplayer widget

Hi,
I made a timer and I want it to be visible for all player in the session.

The problem I am facing is that it shows on the host client but not to the others.

The first one Replicates on “Run On Sever”
and the StartSurvivalCounter replicates on “Multicast”
This is running on my FirstPersonGameMode.

What am I doing wrong here?

Unluckily, you’re doing a lot of wrong things:

  1. Event Tick (also BeginPlay) fires on both client and server. You’re firing a server RPC from both places, where it’s designed to be fired from client. That’s why people usually do a SwitchHasAuthority to split the two paths, with Authority pin being server, and Remote pin being client.

  2. GameMode is a server only, non-replicated actor, meaning the previous point isn’t valid at all, but I mentioned it, so you keep it as a note for other replicated actor classes. In addition, RPCs can’t be fired in actors that are not replicated, so surely not GameMode.

  3. Reliable RPCs are not performance friendly. Them fired on tick is really bad, as that will fill the net buffer quickly and other RPCs won’t be able to pass through.

With all that being said, what’s the fix?
Here’s your fix:
UE4_Network_Compendium_by_Cedric_eXi_Neukirchen.pdf (1.6 MB)

Read it a few times, and then come back to what you were doing. You’ll get to the conclusion that you should have done your logic in an actor class like GameState, with the timer fired on the server with no RPCs involved.

1 Like

Thank you so much, I will read the pdf and hopefully I will understand it more.