Raycast Suspension Wheel Module | An alternative to standard physics based wheels

Background

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.

Where do I get it?

You can find the source code here: GitHub - LeehamsonThe3rd/raycastsuspensionwheel: An easy to use ROBLOX module that allows for wheels with raycast suspension instead of the standard physics based wheels

How does it work?

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

45 Likes

This is absolutely gonna be useful for anyone that’s planning for creating a game with cars, thanks for sharing it :smiley:

6 Likes

I tried using the module to rig a car up in my game, but I do not completely understand the documentation example. This is what the rig looks like
RobloxStudioBeta_Q6qVHZs14E
each wheel has the same attributes
RobloxStudioBeta_f36q3lf3tx
and there is no errors
and I just copied and pasted the example code but nothing seems to happen:
RobloxStudioBeta_RPvrD1OvJC
do I need to set the parts in the motor6D object?

1 Like

there are some internal errors i still have to get around to fixing so as of now this module isn’t currently usable. Sorry for that.

2 Likes

Is there any update, or still broken?

I did fix it actually however if all the vehicle wheels aren’t level it will cause problems, the friction forces also aren’t perfect.

is the github link updated? or still broken

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.

so is this updated? can I use it now?

It is updated and you can use it now.

1 Like

I followed the instructions, but the module is not working, and doesn’t output anything also

it appears you did your welds wrong, so perhaps look into that.

1 Like

I can’t get it to work either. It looks like everyone followed the instructions exactly, however.

I apologize, i uploaded the wrong file, check out this example for further assistance
vehicle(1).rbxl (65.3 KB)

4 Likes

Much appreciated! I understand it now.