Raycast suspension or spring constraints suspension

i have spent multiple days making a raycast suspension system and the final result was not that great

so i am wondering if it is really worth it to make a raycast based suspension over just using the spring constraints.

i first decided i wanted to use raycast since because a game i made, more of a test place, had tons of lag from all the vehicles using spring constraints. so i am wondering does spring constraints actually cause a lot of lag when a lot of players get into one game all with a vehicle or was my script just very unoptimized

pros of raycast suspension:

  • believed to be less lag heavy
  • dont have to worry about collisions

cons:

  • one line determines where your wheel is at even though the wheel is much bigger
  • if a part goes above the wheel in that empty space between the chassis and the wheel, the wheel will shoot up

pros of constraint suspension:

  • the entire wheel is calculated for the suspension
  • a lot less work is needed to get it done

cons:

  • believed to be more lag heavy
  • some issues with people standing on the vehicle and the springs freak out and push too hard and send the vehicle flying

these pros and cons are from my experience with working with both raycasts and spring constraints

3 Likes

I know Constraint vehicles can cause quite a bit of lag when there are a lot of them. Especially if you are also including extra Constraints for items like double wishbone suspension.
I think your issue with springs and ‘passengers’ is more to do with balancing out the densities of everything joined by Constraints. If you have a Part with the Density set to 2 Constrained to a Part that is Massless it could be very glitchy.

none of my parts were massless. i used whatever the mass of the model was

all of the density of the parts was automatic, didnt change the custom properties

there was about 30-40 vehicles during that testing session running around. mostly tanks using beams for the treads

my constraint setup is an invisible part that is massless, this is the only part that is, to connect all the springs and cylindrical constraints

attachment0 is on the invisble part
attachment1 is on the fake wheel, an invisible cylinder to prevent bumping
same attachments for springs and cylinderical constraints

Like I said, if you have parts with Mass (Density) and you connect them with Constraints to a Massless Part then you may have issue.

1 Like