Download

Problems with client-server door sync

enablecontrols.png
1e6acd66372112069a1c97ad1b5320af20db99ff.png
4d8f527e44da6ca745a64d19032201bd58327fdd.png

hi community

i need some help with my project…
when a client is is opening the door it is working correctly on his screen but the server doesnt open door too.
is there anything wrong with my blueprint or am i missing something with the player input?

please help:)
much love

Hey. So if your door is level you don’t need to make a run on server event. Try on press F, send it to play on the timeline and in the timeline, check the box that says replicate. I have a door that when pawn enters the trigger it plays the timeline, and leave the trigger it reverses. Works with both client and server just with checking the replicate box in timeline. Cheers.

The problem is, you are doing it simply wrong :open_mouth:

The RepNotify is called on the Clients when the Server changes the bool.

So when pressing “F” you want to call a Custom Event that is set to “Run On Server”.
(Note: If you have a Listen Server, so that a client is also a server, use a Switch has Authority to split the server
and client logic).

This event will be called on the server when a client presses F. The Event should change the Bool from true to false or other way
round.
(Note: If you have a Listen Server, you will want to put the logic of this bool change also behind the Switch has Authority exec with
“Authority” and the Client exec gets the custom Event. So both ways, it is called on the server!)

Now, because the server changed the bool, the RepNotify is called and you can decide what to do, based on the bool value.
The things you want to do should NOT be a Multicast. It should just be a normal function that handles the door opening.
Because the RepNotify is somekind of multicast.

@eXi

b785788f2701a44d503cdcb8233de176b609c997.png

i´m not 100% sure if i understood what you said but this is my interpretation of it …
is it close to what you meant?
btw its not working so i guess its not exactly what you meant :slight_smile:

@DJ-INSERT

my version also work i just use the triggerbox to open the door but not if i want to open it with an player input

It is similar. Do you have the Open and Close Door Event in your OnRep function?

I don’t have time recreating this right now. Maybe this evening.

Yeah…
both Events get called in repnot function as not replicated event but the server never gets to the point where he sets the value of the "Doors is Open " boolean so the repnot function is not getting called

I tested the new version and noticed that if the client pressed the f button he want to call the new custom event but the server never gets the “signal” to run the actual event (Runs on server) …
meaning that the whole blueprint stops working after the Client calls the event

Ahh wait where are you calling this? In a door actor or something? This is failing because of wrong net ownership. You can only call RPCs on actors that the client is owner of. First thing in line would be the playercontroller. You might need to create the RPC logic in it.

im really fustrating right now with this door…
i tried many different combinaion of blueprints/event/function etc. combination and nothing works…
i really think think im missing something …

I will give you something that works, but right now its 23:54 in germany and was up all day. I will get to this tomorrow (:

Are there any news for this?

Ahhhh, my fault. I just realized (while seeing that i had posted here) that there were 2 guys asking for help and while providing something for the first guy, i forgot this here.
I’m sorry! As soon as a find time, i will try to do something :< In the meantime it would be nice if someone else could spend its time to create an example for him, because
i really don’t have much time right now >.<

is there anyone who can help me with this problem…?

In the door bp, add an overlap, and on overlap, set a variable that has replication set to rep notify, and on rep notify, execute the timeline, the ONLY thing that should have replication turned on is the rep notify variable.

Solved.

Solution:

Thanks to everyone trying to help, especially eXi who gave a great example and explaination.
To clarify whats we wanted to do, a simple “near the object”-interaction with a key. e.g. a door should open/close while a player stands near the door and presses the E-key, for Singleplayer it would work with a really simple setup, but as we are talking about multiplayer, we have to improve the BP a little bit, so that if client 1 opens the door client 2 should see it too, in his example he used the playercontroller as bridge to let the RPC run on the server, due to the fact that the request “of the door” would just get dropped (missing netownership). Hopefully I explained it well enough for other users!

eXi:

Excuse me
I have the same problem
Need your answer