I am currently making an obby game and I made lots of stuff client-side to not keep the server busy, and low ping, and I am using a singular remote event to start the stages on the client.
One issue is that, when I call the remote event to load the scripts, there’s a desync between the players, the platforms that rotate do not match the platforms on the other player’s screen and it’s becoming a problem when there’s a timing stage.
I’ve tried my best by trying to load the scripts once, and at the same time with remote events with the other player, and tried to delay the remote events a little to see if the server was busy at the moment, but nothing really worked out for me.
Example code (not the actual source code):
Server:
function StartPlayers(Player1, Player2)
LoadScripts:FirePlayer(Player1)
LoadScripts:FirePlayer(Player2)
end
Client:
function LoadStages()
miscfunctions()
end
LoadScripts.OnClientEvent:Connect(LoadStages)
How do you go about syncing clients around in your games?
Like a script that rotates a platform, where the platform rotates once every 4 seconds, would want to be started whenever workspace:GetServerTimeNow() % 4 == 0
Thank you for the solution, one thing I did different is that I calculated the delta time between the last post simulation and the time now, and by that it works flawlessly. Thanks!
Edit;
The sync is way better if you just calculate the angle from the first start position, instead of using the delta time iteratively (obviously), just add the angle you calculated on the start position.
Start * Angles(0, ServerTime, 0)