Trackmania like car physics (paid)

Hi there,

I’m trying to make a trackmania-like physics, which I think is one of the most enjoyable arcade racing games.

Right now, I’m based on this repo, that has a really simple but good starting point.

This is what I want to achieve:

And this is what I have:

I have made some improvements to the base code, so I’m not that far to achieve what I want.

What is missing:

  • Smooth loop: I want to avoid that jerky behaviour when the car enters the loop or any other slope
  • Smooth landing: when the car is in the air and is going to land, the landing is not that smooth
  • Suspension: I’m not sure how to achieve a good balance, if I apply higher downforce the suspension gets too much low

I’m looking for someone that can help me to get a good aproximation to that Trackmania car behaviour, which is always fun and so predictable.

Here is a package (Unity 2020.1) with the track and car, without my tweaks, if anyone wants to work on it:
https://drive.google.com/file/d/19FpQMRArVwOysTC3rRTrQvJp9gFlAlxk/view?usp=sharing

Any help will be really appreciated, even if anyone can provide good custom support (via mail: vancete07@gmail.com), I can pay him some beers (or many if the help is good enough).

Regards :wink:

A (very) quick look under the hood of the script shows its using a single raycast for each wheel to get its contact point, so I think what you’re seeing is the result of the track loop’s mesh collider possibly not being granular enough and the fact its not using a circular shape as the collider.

You could add an extra few raycasts at 20 / 40 degrees to help even out the contact points. I know the physX wheel collider has had a lot of bad write ups but it does solve this issue well. I’d recommend checking out the latest kart scripts from the karting microgame, they’re pretty good (and simple) and using that controller should solve the jankyness! (I also recommend Edys Vehicle Physics as a good system to learn from)

Thanks for your answer.

I’ve been trying the karting microgame, it solves some things but introduces new problems, so I think I won’t work on it.

I’ll send you a pm.