Run on Client - Doesn't get called on the Owning Client

Greetings, Hope everyone is doing good today.

I’m having a small issue perhaps someone can point me in the right direction. Its relevant to network replication. I have a RunOnClient that gets called sometimes, and sometimes doesn’t. What I mean is that there is a function marked as (Client, Reliable) on the PlayerController that is always called on the server side, but on the Client side, it gets called when it feels like it lol.

The framework is the following.

Server receives input from the client, verifies values.

Once the information has been Confirmed,

  1. Call GameMode function that calls a GameState function

  2. Runs logic, then it calls a Client function inside the PlayerController.

Breakpoints indicate, both the reference to the PlayerController is correct and the Function is in fact getting called… it’s just that sometimes the Client never calls it on his end.

Any tip is more than welcome!

As always Happy Dev’n!

UPDATE ----------------------------------------------

So I toggled between Reliable and Unreliable and had some interesting results.

  • Reliable : Whenever the function is not called on the Client side, I have to close down the Dedicated server and re-open it to try again, otherwise if I keep trying the input without closing the Dedicated server, it’ll keep calling the “Client” function but it’ll never be received on the Clients end.
  • Unreliable : When the function is not called on the Client side, I can just enter the input again and it does called not always on the second try, but surely in the next couple of tries without the need to close and re-open the Client or the Dedicated Server.

I have a UDPComponent, that is created in the constructor of a UDPActor, which is Spawned through the Begin Play of the Level Actor with a (HasAuthority) to confirm we spawn as a Server.

So , Client inputs name → Tells UDP to send data to Other Dedicated server, → Once received, it verifies some logic and returns the answer, indicating if he in fact can choose that name → Calls UDP to send the info back to requesting Dedicated Server → Dedicated server calls GameMode Func → Calls GameState Func to confirm the requesting Client → Tells Client to call Run on Client function located in the player controller…

I don’t see what I’m missing… and what is annoying is that it works sometimes… Should I have bReplicates on both the UDP Actor and UDP Component?.. or where should I be looking for the error… again, the UDP communication is working fine since I am receiving the information and the values are all correct.

I have a on going server that manages the Matchmaking process, and is in charge of creating other dedicated servers to gather small groups in. Both of those server have different maps and different GameModes. I debug with breakpoints and the correct GameMode is being called once the small dedicated server is receiving the info back from the Matchmaking Server.

The only reason why I would see a Run On Client not being called is if the actor who is calling it is :

  • Not an Actor Class
  • That Actor is not replicated
  • The client doesn’t own that actor

So it doesn’t make sense… the Client RPC is a function created inside the PlayerController and that checks all of the boxes… its an Actor Class, Replicated and Owned by the Client. I even made sure that the value of the playercontroller reference is correct, and it is.

Please assist me, I have run out of options and methods to try it… at least point me in the direction so I might be able to figure it out.

Thank you for your time.

PS. I have posted in answerhub as well with no results. - Link: https://answers.unrealengine.com/questions/899532/view.html