Hello everyone, Almost a year ago I was trying to make my own raycast suspension system for a car chassis because I found that making vehicles with roblox physics is way to complicated so I opted to make my own raycast suspension system because it seemed to be faster and looked way cooler. However, I found it incredibly hard to code as there were not many resources on roblox about it. But after a lot of research and revisions I would finally like to present my module to you all.
Basically the car shoots a raycast down onto the floor and depending on how close that ray is to the floor the more suspension force is applied upwards. However this will make the car continuously oscillate, to prevent this I added damping to the system so that the forces even out. With all of this combined you will have what appears to be a floating platform, slap a car body and some tires on it and you will have yourself a car!
Here’s a video I made on the system
Some resources I used
These are just some videos, but there are some other resources I unfortunately don’t remember the links to
Yes, I did update the github repo and changed the instructions and documentation around. I was just stating before the known problems I can’t work out.
i know this is quite an old post but… i really never scripted any cars so… how he heck do i make the car move and turn with the player sitting in it? raycast suspension based cars are hard to work with to be fair
Hey, I rigged my car like you suggested, but for some reason, after a certain extent of height, the car just falls through the floor. Right car is mine, left car is the one you rigged. Did you face this issue when rigging your car?
I did adjust the density of the chassis part and the lower it went, the more height the car could sustain, yet when the car falls face front, it still goes through the floor.
EDIT: I Solved it. Apparently it also requires a body with cancollide on.
Yeah the body has to have cancollide on. Also does yours drift away when it’s not moving? I found out that if you calculated the physics on client with networkownership things are different
It doesn’t drift, it sorta rolls away. I just increased rolling friction to stop that. As for client ownership, i let it calculate once the player enters the car.
Have you figured out how to turn the car? With wheel turning?
The actual car is not driven on wheels, rather than the physics that are assisted by the wheels. Turning the wheels won’t do anything, even how the wheels are spun is just fake velocity. However if you wanted to make it go forwards and backwards just change the vector velocity under them. If you want it to steer, you’ll have to stick with changing the angle of the body itself either using cframe or assemble angular velocity - you can also do the same with the wheels to mimic that effect.