RPCs From Client to Run on Server

I’ve been having some issues with the best way to run RPCs on actors that aren’t owned by clients. I’m aware that I can’t run an event on the server from an actor that that client doesn’t own but I’m not sure on the way to work around this without putting all the logic into the player character.

In this particular instance I’ve got a player interacting through an interface with an actor in the level. This triggers an event on that actor which triggers another event on the actor that I wish to run on the server. When run on the client this second event never occurs as it doesn’t own the actor being interacted with. Is there a way to do this or is there a better place for these events to be other than the unowned actor in the level?

Any help would be great, thanks in advance!

Hi, I do all interaction from the server. So you would put the input to interact either in the player controller or the controlled pawn (player character).

Then from that input you call a Run On Server event. Then you continue all your logic from that event on the server.
So in your case: input on client → RPC to Server → server interacts with actor through interface → actor triggers event on second actor.

Basically for everything network relevant (replicated) you want to see the client only as monitor plus keyboard, but no logic. So directly send the input to the server and continue from there.

That’s great, thank you!

I’d recommend taking a look at this document to get a better under standing of replication events A Crash Course in Blueprint Replication - Unreal Engine