Some of the replicated functions do not fire

In my game I have many replicated functions, and when several functions are going from the server to the client at the same time, some of them are able to not replicate. The function is called on the server and just nothing happens on the client. How to fix this?

Bump. The topic is actual.

Double bump.

Triple bump.

Quadruple bump.

Quintuple bump.

Did you check the log for warnings and errors? Without more detail my best guess is that the connection is saturated and the RPC gets dropped.

Hello @GarnerP57! There are no warnings or errors in the log. But why it is dropped? Why is it not called sometimes later? Is it an Unreal Engine bug, or am I doing something wrong? And what can be more detail? There is just custom event with label “Executes on owning client” and call of that event from the server, and no details anymore. The execution flow on the server goes to that call, passes it and continues. On the client that custom event is not called (I tried to set breakpoint on the custom event on the client, and it does not trigger).

Hello @Etyuhibosecyu . The small details matter in Multiplayer since a lot of things can fail. You should also verify that your assumptions are correct by using print string since breakpoints can also trick you or do weird things.

So if you are calling multiple “Run on Owner” events then you should check if there is a valid owner when it gets called by the Server and the Client should also be ready to receive the RPC by having the spawned Actor. The example that can be problematic is if you Spawn or change ownership but it has not yet happened on the client then the RPC is dropped. ’
Generally it is better to use Replicated variables if the eventual state is important but not the intermediate state.

When making RPC calls they need to be reliable and on the same Actor for them to be received in order otherwise you might receive it in random order or not at all if the owner was not set while some of them got sent.

If it is important that all the calls arrive at the same time you should consider using a Replicated Struct instead. If intermediate changes are important you might want to use a Reliable RPC.

Lastly when sending RPCs you also have to consider the clients current relevancy on the Actor being used as it would drop the RPC while “not relevant” even if the RPC is set to reliable.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.