i have a car and he drives nice and stable.
the only problem is when he is jump over a little hill.
the car need to go faster back to the terrain.
i have following script attached to my car but no of my options works for me:
var fly = false;
function OnCollisionEnter (collisionInfo : Collision) {
if (collisionInfo.gameObject.tag == "Terrain"){
fly = false;
}
}
function OnCollisionExit(collisionInfo : Collision) {
if (collisionInfo.gameObject.tag == "Terrain"){
fly = true;
}
}
function Update() {
if (fly==true) {
// i tried this options
transform.position.y -= 30 * Time.deltaTime;
transform.position.y -= 1;
rigidbody.AddForce (0, -10, 0);
}
}