Execute action on server not working

I have a function that I added to the gamestate. It just prints a logging message for now.

I’m trying to call it from a widget blueprint, but I can’t get it to work.

My flow so far:
Default map is “MyConnectLevel” which shows a “ConnectWidgetBlueprint” this gets an IP address and connects the user to the server. This works great.

Then the map changes to “MyLoginLevel” which shows “LoginWidgetBlueprint” which has a couple string inputs, When the button is pressed my function should execute on the server only.

Here is the login BP.

Any idea what I should do differently? Thank you!

2 things you should know about client to server rpc calls:

  • They only work on objects owned by the player.
  • They only work on objects the server has created and sent to the player (the “same” object must exist on both server and client.)

You may find this helpful: http://puu.sh/lUNjk/60d13490ae.png

You can only really do C2S RPCs from the player state, controller or pawn.

Thanks for the response TTaM. That is helpful.

I put my little bit of logging code in the character controller, but I’m still not seeing anything happen in the server console log.

Sorry for the noob questions. Does this look correct?

That red ‘Executes on server’ event needs to be on your player controller (or state or pawn,) not in your widget blueprint.