Is it possible to calculate the exact force required to keep a rigid body hovering in the air with gravity on and taking into account the bodies mass etc. This force will be applied along the Y axis.
I wish to make my craft hover perfectly and want to be able to dynamically change the weight etc.
Taken from unity tutorials:
if (Physics.Raycast(ray, out hit, hoverHeight))
{
float proportionalHeight = (hoverHeight - hit.distance) / hoverHeight;
Vector3 appliedHoverForce = Vector3.up * proportionalHeight * hoverForce;
carRigidbody.AddForce(appliedHoverForce, ForceMode.Acceleration);
}
That will basically try to maintain a hoverHeight.
You can do the full tutorial here: Unity Connect