How to make a vehicle climb any hill ?


I created a mars explorer game… I import mars raw data and then use a vehicle with rigidbody to explore the terrain… but for some reason the vehicle doesn’t climb not all hill’s it also flips over and lands upside down…

Is there a way or a setting in rigidbody to providing this ?

Kind regards EMM

When using rigidbodies, the center of mass is calculated from the number and total area of colliders attached to an object. Unity may be setting the COG too high, causing your vehicle to flip easily or to lean outwards too much when turning. This is especially evident when using Wheel Colliders. It is recommended to use some anti-rolling code like that found here:

How to make a physically real,stable car with WheelColliders

Or if realism isn’t an issue, you can artificially lower the center of mass in-game.

var centerOfMassOffset : Vector3 = Vector3(0,-0.5,0);

function Start() {
     rigidbody.centerOfMass += centerOfMassOffset;

Thank you for the repley…i gonna try it…