Help with calculating physics for a raycast suspension vehicle

Hello everyone. I’m continuing development on my raycast suspension chassis and everything is going well so far, I just finished getting the springs to hold the vehicle up and dampen. I’m using VectorForces instead of BodyThrusts.

Now, all I need to know how to do is forces - but I don’t know how to apply them to Roblox. I’ve found this gold of an article - Car Physics

But some of the most important equations here like friction, drag, etc don’t apply well to Roblox (at least for me) and either cause your chassis to fling around or glitch out. The explanations are somewhat understandable, though.

I just need some explanation on how to code these forces nicely for my car and I think I can handle the rest:

- Friction
- Drag (optional, not sure if I need this but I’d like to learn if anyone knows.)
- Acceleration/braking
- Turning
- Calculating torque curves to stimulate gear transmission (not really sure how this works at all. I think this is the term but what I’m trying to say is gearing.)

Also I have an idea of how these work but I’m just not able to apply it to Roblox. That is what I need help on.

I’ve only found one way to do friction, which is what the default Jeep uses (Sets the MaxForce of a body position when you’re not throttling), but this doesn’t work well when the car is driving since there’s no friction on it. It’s only intended to work when the throttle is let go.

I also have a few more questions while I’m at it.

  1. People typically Weld/Motor6D wheels to the thrusters and then change the C0 of the weld to make it look like the wheel is touching the ground. This is completely fine on the client, but how would I replicate this to other clients efficiently? I’m pretty sure that doing this on the server can be REALLY intensive, but it seems like the only way to get it to replicate without looking too bad. Does anyone have any ideas on how I should replicate wheel C0’s efficiently? Or does anyone have another method?

  2. People who are experienced with raycast suspension, how do you handle network ownership of each car and make sure everything is replicated correctly while looking good? Like I said before, the thing I’m most concerned about are wheel CFrames.

  3. Where should I be applying the forces listed above? In the center of the chassis or in each thruster? Or both?

I would really, really appreciate help. I just need help and explanation on these and I think I can continue from there once I get an idea of how to control these forces with my chassis.

5 Likes

Update: It seems like the equations on the website do work so far for drag and friction, the problem was that I didn’t convert velocity to the local space of the chassis. Going to continue with these equations, so far so good

1 Like