@@Octopot-4-Life Ima try to break it down the best I can, but tell me if anything is still confusing The base chassis is consisted of a seat, a big car-sized part, 4 attachments (positioned in the corners of the car, or wherever you want your wheels to be), and 4 vector forces that are the children of those attachments. Basically, it looks like the thing in this video (without the green lines at every corner) ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-czfObRvi9e0.html You send a raycast to the ground from each attachment, and calculate the distance. Using that, you can use hookes law to get a spring force calculation for every vector force. Just put that calculation in the y vector of the vector force and it should push the car up. If you have no idea where to start with hookes law and calculations and stuff, this video is really good ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CdPYlj5uZeI.html
@@Beef_Piehow did you get the vector force to not make the car constantly go up? I've been trying to do this exact thing and my car is just either getting flinged up or just starts floating up slowly. I'm assuming there's an equilibrium but I don't know how to obtain it.
@@xenom2817 Theres a cou[ple reasons why this might be happening 1. Some part on your car isn't part of the raycast blacklist, so the car is gonna keep springing off of itself (I hope that makes sense) 2. For the vector force, you might be adding the force onto the force from the previous frame instead of just directly setting it (Makes it infinitely rise) 3. When the rays dont hit the ground, make the vector force equal to zero, or else its gonna freeze the force at the last value it was given, and it will speed up exponentially Besides that, there could be some bug in the way you implemented hookes law, and you probably just needa make one of your values negative or something (which yes is annoying as hell) If any of the first three things don't work, lmk and i can probably think of something else that might be causing it. Its 1 a.m. for me rn so my brain is fried lol
bro for real, i've been hating ALL roblox racing games since every one of them had the same bullshit suspension and physics, they were so unrealistic and unfun, car gets stuck everywhere and just going through the terrain shown in the video was a torture. but with this system you created, it actually seems enjoyable and realistic, if only this was implemented in most of racing games roblox would have better games related to cars.
im strugling to reach this result, dude. Some chance of you to sell it so i can study ur methods? i have a channel of roblox programming in portuguese and im trying to realize a way to do that. Already tried some unity/unreal tutorials, but nothing really helped until now. Prob its just me being dumb. If theres a chance of selling it, plz let me know.
@@Beef_Pie yea i,ve since fixed it, it was just a problem with the stoopid formula, although using vectorforces makes the suspension weird doesnt act like suspension instead it feels like it just bounces up and down
Hello there i don't know if you are even gonna read and reply to its but does this ray casting technic can be use for car with multiple wheel like a truck with 6 wheels or even tanks.
This is good suspension, and for stiffness you jjust need to mutliply your car mass by gravitational acceleration, and then divide by amount of wheels, 4 in this case, and then you get force number for each suspensipn, but one problem im struggling is damping, as I dont really understand it, and theres no way to make shock abosrber, any tips?
Your dampening force is pretty much just the product of your wheel velocity and some constant dampening value of your choice (The higher it is, the less bouncy your suspension will be. I like to make mine 1/10 of what my stiffness value is) So, the dampening equation is as simple as (Velocity * Dampening) = DampeningForce Then, you subtract that from your stiffness force, which will allow the springs to slow down and come to a stop Full equation: SuspensionForce = (StiffnessForce) - (DampeningForce) If I didn't explain it well enough, this video is really easy to understand and should help you out ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CdPYlj5uZeI.html
kinetic friction = mu * normal force * (- component of velocity parallel to surface) normal force = mass * gravity * suspensionforce suspension is usually an ideal spring, so suspensionforce = -k * displacement (most suspension also having damping, so include that too) mu and k are determined experimentally irl the negative component of velocity parallel to the surface can be calculated analytically by taking the projection of velocity onto the normalized surface normal vector, and subtracting it from the original velocity vector
Man I been struggling making one for months, usually cause when turning a certain direction the speed of the car goes up to 9999, and don’t know how to apply the force in the attachments look direction cause it doesn’t face the same direction as it’s parent
When you say the attachments don't face the same direction as the parent, do you mean that they don't rotate with the parent when it's moving, or that they just have messed up orientations to begin with
@@Beef_Pie yeah they don’t rotate when the parent is moving I been trying to apply the acceleration force in the direction of the attachments and they are all inside a part(car) but they only face the x direction or whatever instead of facing the direction of the part(car) so it doesn’t work right when pressing a and d to turn the front attachments 45 degrees or whatever so the car can turn Also attachments are inside a part and used for the raycast suspension and other forces
@@imadahmed4510 The red dots at the top are where the ray originates from, the ones at the bottom are where the rays hit, and the ones in the middle represent the wheel radius