Widget button not calling run on server event.

The widget button is not calling my event inside my hud that is a run on server this is my blueprint code:

Are you calling an event on client side to test your data ? Make a branch and two print string(true and false) on a client side event, if " Team chosen" is replicated client will have “Team Chosen” to true.

Yes i am nothing is being set on client or server side,

The reason is, that you Can only call RPCs from your PlayerController, GameState or a possed Pawn.

A work around would be to call the function in you PlayerController.

I personally do not like this limitation because it restrains the possibility of modular programming.

Does anyone know if those limitations exist in C++ scripting as well?

1 Like

Yea i just cant get it to work i’m just going to drop the widget and let the game mode decide teams thanks for the help though.

I can’t work it arount. I create this 2 functions is player controller and in widget i am calling client event, but server event doesn’t start

No, but i fixed porblem by another way. I called it from actor, and it’s working only than i am setting to this actor owner on server and actor owner == widget owner. Cannot call server RPC from clients - Multiplayer & Networking - Unreal Engine Forums

Does it work when you directly call the “run on server event” which is called “Server” from your widget?