MeshParts with Constraints cause physics lag

Physics lag becomes very noticeable when moving models containing MeshParts with constraints. This is very noticeable with the train models in the game. Everything is handled on the server. I have some examples to show here:

Below: Minimum lag with less train models. This is what I want to achieve even with a larger amount of train models.

Below: Very noticeable lag with more train models (still has the same results even without a joint breaker).

Below: Less train models, but more vehicle models (still lags, but not as worse as the second one)

I have tried handling physics on the client (this is single-player), but it broke other important scripts/physics in the game.

The chassis includes SpringConstraints + PrismaticConstraint for each wheel, as well as the suspension.
The bodies are mostly made up of MeshParts and have large densities (heavy).

1 Like

More Constraints = more physics computations = more lag.
I have a lot of experience trying physics based suspension/construction vehicles/boats/trains.
This is a simple system that works with pretty much the minimum constraints to have rotating bogies with tilting so trains can smoothly go around corners and up and down hills. It doesn’t use suspension because the track I made is pretty smooth, and it would just add more constraints to the model.

I’m not using lots of trains or lots of other vehicles, but the picture you showed seems to have a lot of constraints in it.

Physics for a single player game should be handled entirely on the client if possible to save the ping lag for server sided physics. You may want to try that again, and ask here for suggestions about why you’re having issues with client based scripting.

You can try this for ideas:
Train test, bogies with tilt (VectorForce or Hinges).rbxl (191.8 KB)