I’m trying to set up a door switch that locks and unlocks doors in my level and works in a multiplayer context (i.e. both server and clients can interact with said switch to lock/unlock doors.) but I’m running into a problem on the client side and I can’t put my finger on the exact cause.
Here’s the event graph from my Blueprint:
The DoorSwitch function is set to execute on server with SwitchHasAuthority and everything works great when the player on the server steps into the ConsoleTrigger volume and presses Interact (E)– doors lock/unlock properly and switch color changes on server and clients, but nothing happens when a client attempts to do the same.
Watching the Blueprint while playing in the editor, the OnComponentBeginOverlap and OnComponentEndOverlap events fire when either client or server enters/exits the trigger volume but only the server fires the rest when Interact (E) is pressed. Even the PrintString in RPCActivateConsole refuses to fire from the client.
Blueprint is set to Replicates=TRUE under defaults.
My current theories as to why this isn’t working are:
1 - My Blueprint was placed in the level manually via the editor, which I believe causes it to be owned by the server, which might explain why the client RPC isn’t firing.
2 - I’m not actually getting the right PlayerController for Enable/Disable input. I know that GetPlayerController only works in a local (split-screen) multiplayer context so I’m trying to use GetController but I’m not 100% sure that I’m doing that bit correctly for client/server multiplayer.
if It’s #1, how can I either change the actor’s owner or change the way the Blueprint spawns into the level to make it accessible by clients?
If it is #2, what should I be doing instead?
If the issue is somewhere else, please let me know.