Networking client-server for a simple interaction

Hello everyone, i’m struggling creating a simply door opening in a network level. I’m using Collab Viewer Template, settled down as a “Listen Server”.
I created my sliding door blueprint and set it as “Replicates”.
At the moment if the host (server) modifies something, everithing works fine, and all the clients are updated, but if client interact, it works just on client side, server aren’t updated and no propagation happens obviously.
I’m using RepNotify on the boolean variable, and i tried to link also “remote authority” to the toggle node, but just on client side works.

Thanks

Tutorials linked at the bottom cover doors.

You need to make a RPC that run on server to toggle door.(Or modify your ToggleDoor event)
image

On your client, call the function.

Hi Kiray, thanks for your reply, i switched on a simple try but with the same concept (switch material to a cube) on the same template Collab Viewer.
I tried to do as you suggest but nothing happens (creating an RPC function with the same logic). It seems the client hasn’t the possibility to interact with the actor. But the server works and changes state for clients too. (Red-SERVER, Blue-CLIENT)



In order for a client to raise RPC events, it must own the actor.
To do this, you need to call the SetOwner function ON THE SERVER.

In my project, I made a macro that, through a component in the Player Controller, asks the server to make the client the owner of the actor in which the macro was called.