Hi there, I’m having some replication issues that I can’t solve.
When I update my test variable (by pressing 6) it executes the ServerTest event (server replicated) and then the ServerClient event (multicast replicated). The ServerClient event adds 1 to the test variable. When I execute the event on the client it shows that the client and server test variable has been updated to 1 but when I verify this on the server side (by pressing 7) is shows the value to still be 0.
I recreated the same code on a new project and the same issue happens, any help would be much appreciated thank you.
the function being called by pressing 7 is probably being called on the client. Extract it out to a function that executes on server and call it from the 7 keyboard input. You should then get the value that is on the server
You need to do the number increment on the server! The set test part needs to be called before you call server client (just copy that segment between sever test and server client)
Hi, what I guess is happening here, is that as your press 6 or 7 it gets executed locally, on the local pawn. Which means, that if the client presses 6 or 7, it gets executed on the clients version of the clients pawn. If the server presses 6 or 7, it gets executed on the servers version of the servers pawn.
That means, client presses 6 → Client and Server increment the Test variable on the client pawn. Server presses 7 → you print the Test variable on the server pawn, where it has never been changed. It was only changed on the servers version of the client pawn.