Hi there,
I have a blueprint graph on an actor that has a variable named “Running”. This variable shows the current active state of the actor. It’s a repnotify variable, so when it’s value changes on the server, it should change on the client, but this is not always the case.
Here are some described logs that I have to show the issue:
**Running is set to true**
Server: Running: true
Client 1: Running: true
**Running is set to false**
Server: Running: false
**Not updated on the client**
Looking through the references to the Running variable, the above graph is the only place that it is ever set.
One thing to note is that if I update the value in quick succession, it works fine, every time, but if I wait too long (say 10 seconds), it’ll just sort of disconnect and the client won’t update until the value is changed again on the server.
I’ve tried everything I can think of to get this working but no luck.
So just to clarify, you are saying that the bool does not fire repNotify when you build your server from the source version of the engine & connect as a client?
Or are you using a binary version with a listen server?
Ok So I tried it on the dedicated server + 2 separate clients.
If the client window is focused it only updates (click on any of the clients and the other one doesn’t update then, not a bug probably just the way processes are run)
If I put the focus on the dedicated server (with -log command to show it’s console), both clients update in sync.
Here is the dedicated server version showing how it updates
Here is the c++ version with client and server target files BoolOnRepNotifyCPP.zip (407.8 KB)
I’ll test if there is an option to keep the game running in the background after packing, this might mitigate the weird behavior on one pc.
The other thing is that because unreal uses an authoritative server model I’m guessing the server will always run first before the clients (ever so slightly). They will always play a bit of catch up unless you are using some form of client side prediction.