Beginner Replication

Hello, I would like help regarding replications, I have several things replicated in my game and until now I had no problem, I have a CodeLock system to open a door.
On the server side everything works as usual on the client side each client sees their door open but only they see it. I replicated everything the classes the variables the statics mesh the timeline I don’t understand where is it stuck?


1 Like

Are you sure you have selected Replicates on your actors / pawns where this BP Snipped is from?

If you put Print String on Open door event and test it locally, it should show you where it is invoked. Like “Server: Hello”, and “Client: Hello”. This will make sure this Event is invoked everywhere. If that is the case, then debug these branch (if) statements, and se if maybe some of those do not pass on Server. I would say that problem is there. Maybe some of the passed parameters is not properly replicated.

It is unclear if only clients see the change, or server does. Can you clarify the workflow and expected and actual results so that we can help a bit easier?

1 Like

Sorry if I wasn’t clear, being a beginner I followed this tutorial https://www.youtube.com/watch?v=_Re4zRotvEI&list=PLGm9gBuuMTevYvJubYrybU47h0ZvYRUjK&index=7
. it is a door system with different key/codelock interaction etc.
everything works fine to open normal doors on the client and server side no problem, but on doors that need the codelock/keypad to open it only works on the server side. I tried to debug with prinstring but each time the print prints 3 times (example on screen) is this normal?




OK, so if they do not open on the client side, but event is invoked, then it’s about what I have mentioned above - some of the branch statements does not pass. What I would do, is change things a bit.

  1. I would create event that only opens the door, without any logic check if it should open. This event would be Multicast (server and client)
  2. All these branch statements would only be invoked on server, as the server is the only one who should check these prerequisites.
  3. Once the server is sure door can be opened, it invokes event to open the door (the one that does not have any logic behind it), and that’s it. Since the event is multicast, it would open the door to everyone, and check is only done on the server side.
1 Like