"Run on server" replicated event is called from non-owning server

Hello. I have been using replicated custom events in my PlayerController Blueprint to send messages between client and server.

The “Run on server” option for event replication updates the node label with the text “Replicated to server (if owning client)” which made me presume that the event is not sent to the server if the node is executed on a client that doesn’t own it.

However, the server’s version of a client’s Controller is executing this node and calling the event (on itself) which I didn’t expect to happen, so I’ve had to branch it with Is Local Player Controller for now.

This may be intended as it isn’t actually replicating if the server is calling the event on itself, but it wasn’t what I expected.

Can anybody explain?

Hi Acren,

When the server calls “Run on server” events, there is no replication involved so any rules involving replication don’t apply in this case. I suppose the wording could be improved to reflect that.

If you need any more clarification please ask away :slight_smile:

That’s what I figured, thanks for clearing that up.

I believe I am having this problem - but have not figured out a way to get around it. I have a box in a BP with a window mesh. The box extends out some distance from the window mesh so that a player can easily stand inside the box. When entered it sets a bool variable to checked. Then, I have a line of logic that states, when ‘B’ is pressed and in the box, SpawnActor. The problem is, when I set the custom event to ‘Run on Server’ (as this is game play vital) nothing happens when testing with the client - there is no spawned actor. In fact everything after the custom event does not fire. On the other hand, everything fires correctly and the actor is created when using the server preview window. Is this because the box is trying to call the function and not my character?

A few screen shot of the BP for clarification.

Thank you very much to anyone that can provide assistance.

Matthew

EDIT: The nodes in the second picture between branch and spawnactor are connected in the version I tested.