Hello, so I have been experimenting with custom collisions. I have gotten a decent simulation going, but I cant figure out how to fix replication lag…
The simulation works SMOOTHLY on the server, but choppy on the client. This is because, when i solve collisions, I have to manually set the position on the server.
And that causes choppiness.
Collisions are calculated on the server, in a Heartbeat connection.
-
Server Simulation:
-
Client Simulation:
-
Client Simulation (Only tweaking velocity, without setting the position)
As you can see, there are 2 separate client simulations:
-
The first one, the spheres don’t sink into the ground, but they are choppy. This is because setting the position is what keeps the spheres from sinking
-
In the second one, the spheres simulate smoothly, but they start sticking to the walls / ground, and eventually sink under. This is because only the velocity is affected, the position doesn’t get set by the server script.
So, is there a way to set the position of a part on the server without causing that choppy lag?
Or, is there a way to sync physics on all clients, and handle collisions on the clients. Without the balls de-syncing??
I am open for trying anything!
Thanks!