If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

You know that for an object to stay in rest no forces can be applied on it: Fr=0 (being Fr the sum of all forces applied on the object).
So here you have the gravity pulling down on the ship so you create a force that counters that gravitic pull, making your ship still in mid-air. Then you make that levitating force vary with the inverse of the ship's height above the ground (F=k/h in which F is the force that counters the gravity pull, k is a constant that works like a "bounce" factor and h is the raycast distance between the ship's geometric center and the track, measured perpendicular to the track's polygons) so that the ship maintains it's height after jumps and bumps.

I've set the Rigidbody of the ship to 1000 and added a raycast downwards that stores the distance between the center of the ship & the track. I then have a bounce rate float of 600000 that is divided between the raycast distance, the results are then added as downward force from the ship.

This gives a hover effect but doesn't seem to spring to a height above the track. I'm doing something wrong I imagine, but I don't know what.

Try to normalize the raycast value by dividing it by a set height value.

For example:
Lets use the F=k/h formula:
You want the ship to stay afloat at a height of 2 units, then you divide the raycast value (also measured in units) by those 2 units (h=raycast/2) so that the value of h, when the ship is at 2 units of height, is 1.
When the h is 1 you want the ship to stay still, so you set the "k" to exactly the same value as the gravity pull force only with the opposite direction.
Now you have a resultant force of 0 force units, which means that the ship has no acceleration on the vertical axis, so it still in that axis. It's called equilibrium.

If the raycast value drops below 2 (when crossing bumps and ramps), the h becomes smaller than 1 and that increases the value of the lift force, since dividing a constant (k) by a number smaller than one will output a number larger than k. That increases the lift force and makes the ship accelerate upwards.

If the raycast value is greater than 2 (i.e. after a jump), the outcome is the exact opposite of the last one and the ship suffers the effect of the gravitic pull.