Posted October 09, 2025 by sevencrane
#tech discussion
This is true everywhere from physics to software development. In this case, the car would clip into the ground while taking a sharp turn. This would ruin runs on Desert Speedway and Turbine Climb, and in some cases Rock Loop I. Adding more loops for the Orange Tracks update meant the car was getting knocked off the high speed loops in a way that was unacceptable for an actual commercial product.
What was causing it, and how do you fix it? The stupidly simple fix will surprise you.
Here are some of the things I tried:
Here's what actually fixed it:
While debugging and playtesting, I pulled up the telemetry I made when I was first writing the suspension code and realized the suspension compression ratio was peaking at a higher number than I expected on tracks where the road took a concave curve.
A suspension compression ratio of 0 means there's no compression on the car springs, and a ratio of 1 means the suspension is bottoming out. On loops, it was at 4.5. The suspension was bottoming out, and then some. And then some. The colliders I had on the car body were scraping on the road because of the weak springs and clipping into it, and then getting rejected by the fact that there were two solid objects occupying the same space, which made the car jump into the air and ruin a line.
If you think about this at all, it makes complete sense. A car taking Hot Wheels ass loops at 180 MPH will need stronger springs than a car driving at 10mph on a flat plane over speed bumps, which is all I was doing when I was setting the suspension numbers while writing/playtesting the suspension system very early on in the game's development. The issue didn't become apparent until I started making tracks that actually pushed the system to its limits.
Anyway, that fixed it. There was another issue with splines on long tracks being low-resolution so it felt like the tracks were lower-poly than they actually were, but I found and fixed it in the span of an update so you guys didn't get hit by it. Thanks for reading! I can share a writeup of my wheel code in another post if there's interest.
Why not just use Unity's wheel collider component, you ask? Multiple reasons:
I might talk about my TCS code in another post, because it's kinda niche but fits well with the rest of the car dynamics I designed.