Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Wait don't forget the normal force
(negative dot product of the car's velocity with the normal of the surface it's on)

When a car climbs a hill (and receives positive Gs) the downforce increases because the car "slams" into the curve

When the car goes down the same hill, the normal force is the opposite because it "leaves" the curve

Maybe I read that a little fast but I feel like it's missing from the equation

(1 edit) (+1)

Oh yes, that’s definitely a big part of it. I didn’t touch on it here but the springs’ compression is affected by the normal force in an emergent way via Unity’s physics.

Remember my last post about collider hell? That was because the springs were too weak. When the car was climbing a hill and slamming into a curve (or taking a banked curve, or a loop, any concave surface at high speed) the normal force was compressing the springs past their limit and the car’s body was scraping the ground.

So yes, it’s in the equation, just implicitly and not in a way that I need to calculate explicitly at runtime. I can just look at the springs’ compression and get an idea of it.

(1 edit) (+1)

Oh yeah perfect the

I guess it's also way faster than averaging the normal of all raycasts

(1 edit) (+1)

I actually tried that originally, to do some camera movement stuff. It was kinda slow but the main problem was that if the car was going over bumps or had a couple wheels in the gutter it would go crazy.

I tried a bandaid where I would average it over the last couple frames but then I realized I could just use the car’s local up vector.