Download

Button in multiplayer - Ownership & RPCs

In a multiplayer game, if I have a button/lever in my level that perhaps opens a door, what’s the best way to get that to work since RPCs require an Owner (which a button derived from AActor would not have)? Would you SetOwner on the button to the player who pushed it, and then…? I’m struggling to understand the best approach.

(https://docs.unrealengine.com/en-US/Gameplay/Networking/Blueprints/index.html)

Something like a trigger volume works okay since in that case you .AddDynamic() to the OnBeginOverlap event and have it broadcast a dynamic multicast delegate, however I’m not sure how a simple button would work where you write your own OnPlayerInput kind of code.

Thanks for your time

The RPCs are based on behaviors. Clicking a button doesn’t need RPC but opening a door does. I clicked a button and my controlled pawn try to open a door. Then it call a RPC of my pawn to open the door in server.