Car controller with leaning?

Hi so I’m trying to make a game where you have to drive a car through a crowd of other cars without hitting them. I know it doesn’t sound fun but it is better than it sounds. My problem is I now want to make my car lean out of the curves as if its own force was pulling it out of the curve but all my attempts failed somebody knows where I can get a script like that or a good tutorial?

You will almost certainly find that the basic spring systems in the physics system won’t be good enough here, unless your car is going really slow. That’s just the reality of discrete-sampled physics engines. They do some things well, other things not so much.

Instead, try making a lean pivot in your car’s hierarchy so that the car body leans while the wheels stay flat on the ground. Then fiddle with how far you can lean / roll it, and now you have a numeric basis to aim for. You can compute the amount of lean based on the speed and sharpness of the cornering and have something pretty convincing in no time.

That might be the solution for other people with that problem but what just came to my mind was I should maybe Inform you that my car is not moving because it is an procedrual generating level and everything exept the player moves otherwise I wouldn’t try to make it work through code

This does not in any way change my solution. You just get the apparent velocity and turn from a different source.

Good luck!

Ok if you say so I will try this