While testing my game with friends, I noticed that the door only opens on the client side. I want to make it where if someone opens the door, the door will appear open on everyone’s screen.
welcome to the community.
i think you should start by reading some of the replication basics.
you need to make your door replicated. and open on the server. the client sends an rpc to the server telling his intent on opening then the server opens it.
Client interaction with a door simply detect that it is an interactable asset, then tells the server to interact. Server tries interaction and if successful it calls an interaction event on the door. The interaction event determines the state of the door (open/closed) and flips it.
If Open → Close, Else Open. The DoorState variable is a RepNotify. Repnotifies have a bound function that is executed when the variable is modified (Setting the value).
The OnRep Function uses the value of the variable to call either Open or Close events that handle opening closing the door… Timeline → Set Relative Rotation (Z) of Door mesh.
RepNotifies are replicated variables. When the server sets the value it gets replicated down to each client. Each clients copy of the specific door will execute its OnRep function, therefore opening or closing the door.