Replication stops working from 2 clients to 3

Hello, I’m currently blocked by an issue I’ve never had and wanted to know if someone have any idea of what’s going on.

Basically an event that removes a widget is played on every client. If I have two or less of them, it is called. But with 3 it just suddenly stop being processed.

I verified with breakpoints, the events are just passed by, i can’t get into them with F11.

Here are some pictures for better context :

Interface function called in the GameMode

Where it’s called in the player controller

The actual removing of the widget

The result of what’s happening with 3 clients

Result with 2

what calls the GM Event?

if i had to guess, you’re calling when the server PC exists but the client PC hasnt loaded yet so the ClientRPC is missed

Sounds reasonable. Also: It can be verified by putting delay (long enough for all clients to surely connect) before calling the initial function.
(also should be noted: in such cases - use delays only for veryfying the cause of the problem. The proper solution should not rely on them)

1 Like

Thanks for the answers and putting a delay worked, I thought this condition would check that every client has loaded.

This is in the player controller, calling a gamemode event that counts how many local controller exists

And here checking if every clients has loaded calling the event shown in the previous post.

Is there a better way to ensure that a client has fully loaded than a delay and hope it has loaded during it ?

this should work, i feel the error might be elsewhere.
but this doesnt really work for a load screen? by the time you show the load screen (beginplay) the game is already loaded

Loading times will vary on all clients. Execution delays will never work in a packaged game. You have no way of knowing how long it will take for each client to initialize any given class, much less load a level.

When a client gets its copy of the controller call the loading screen. The controller should be handling the vast majority of UI anyway. It’s the only class on the client that’s truly persistent.

Use a Loading Pawn as the GM’s default Pawn and let it load this Pawn immediately. This pawns job is to check if the level has loaded enough to actually be ready.

When the level has loaded enough the Loading pawn can notify the controller which can then call up to the server.

Here’s enough of the spawn character function to get an idea of what’s happening.

From here the main character can notify the controller when it’s ready so it can remove the loading screen.