I have a vehicle that floats above a terrain object and will “float” over various hills/bumps/etc. I would like to create a mesh for a ramp that the vehicle can hit to get launched into the air. the vehicle is using a capsule collider and the ramp is using a mesh collider. The ship will always come to a complete stop when colliding with the ramp instead of climbing the ramp and then flying into the air.
I also tried removing the mesh collider from the ramp and instead using rotated box colliders. The same thing happens in both instances. Any ideas?
EDIT
here is the most important part of the flight script that controls how high the vehicle floats above the terrain
function FixedUpdate()
{
//other code for random stuff
transform.position = Vector3.Lerp(transform.position, new Vector3(transform.position.x, GetHoverHeight(), transform.position.z), hoverHeightStrictness);
//more code for more random stuff
}
function GetHoverHeight()
{
if( transform.position.y > Terrain.activeTerrain.SampleHeight(rigidbody.position) + (hoverHeight + buffer)) {
if(boosting){
floatHeight -= (gravity + boostGravityMultiplier);
}else {
floatHeight -= gravity;
}
return floatHeight;
//~ thrust = 0;
}
else if( transform.position.y < Terrain.activeTerrain.SampleHeight(rigidbody.position) ) {
floatHeight = Terrain.activeTerrain.SampleHeight(rigidbody.position) + (hoverHeight);
return floatHeight;
}
else if( transform.position.y < Terrain.activeTerrain.SampleHeight(rigidbody.position)+ (hoverHeight - buffer)){
floatHeight += climbSpeed;// Terrain.activeTerrain.SampleHeight(transform.position)+ hoverHeight;
return floatHeight;
//~ thrust = 0;
}
else {
floatHeight = (Terrain.activeTerrain.SampleHeight(rigidbody.position) + hoverHeight + buffer);
return floatHeight;
//~ thrust = 0;
}
return floatHeight;
}