How do I prevent floating and jittering when on the ground and using spherical gravity?

TL;DR: My ship floats and jitters when it lands on a sphere.

To elaborate on the title: I'm experimenting with a 3D space game. I have created a sphere, which in turn has a larger sphere overlapping it, within which, gravity will take place. However, once my player's ship (currently using an arrowhead) lands on the planet, it doesn't actually make contact with the surface of the sphere, and then the ship begins to rotate erratically and jitter. Code below.

private void OnTriggerStay(Collider other)
{
if (other.CompareTag("SoI"))
{
inSoI = true;
}
}


This trigger checks to see if the ship is in the larger overlapping sphere. I have another identical block for OnTriggerExit which sets inSoI to false. I also have a OnCollisionEnter which sets another variable, landed to true, and a OnCollisionExit which sets it to false.

private void FixedUpdate()
{
if (inSoI && !landed)
{
gravityVector = (planet.transform.position - transform.position);
rb.AddForce(gravityVector.normalized * planetrb.mass * rb.mass / gravityVector.sqrMagnitude);
}
}


Simply, if in the larger sphere, then accelerate towards the planet. I tried disabling gravity if in contact with the sphere. It removed a lot of the jitter, however it still floats, and it still rotates side to side. The sphere by the way, is the standard Unity sphere, scaled 10000x in every axis. I don't need code (though it would help), any solution is fine, even if it means abandoning the project.

• The 10000x might be part of your problem. At that range from the origin, floating point positions have a resolution of about half a millimeter, which may be coarse enough to observe jerkiness or vibration at the scales you're using.This imprecision could easily be even greater if your sphere is itself a long way from the origin. Have you tried arranging your scene so the interaction happens close to the origin? – DMGregory Apr 17 '18 at 1:38
• Ah, thank you, this got my mind going. Turns out using an isosphere with a large size at 1x scale then using a mesh collider solved it. I made the isosphere in blender. Turns out is also has a few other pros. Thanks – Devintage Apr 17 '18 at 15:07