The Eluding Gravity Equation
When i was programming my first game "Tank in Space" ( which is about manuvering a tank in space like in "A-Team"), i wanted my tank to orbit the Planet. I searched many sites to see how it was implemented in Angry Birds Space, but none could provide a clear picture. After several experiments i succeeded in finding the equation which makes any object revolve around a planet irrespective of speed of arrival inside gravity field.
You can check out my implementation in my game
The normal equation of Gravity is
If you implement this equation as your planet's gravity equation your object will mostly fly away from field.
Instead of using this equation you can simply accelerate the object towards center of planet by a constant value.
In Unity it is implemented as rigidbody.addforce(ObjToCentervector,Forcemode.acceleration)
This implementation gave rise to another problem. Acceleration increases velocity exponentially which will make the game very difficult to control.
So instead of using Forcemode.acceleration use Forcemode.VelocityChange which makes your game more controllable. Besides you can change the Drag of the rigidbody to have even more control. I used a value of 0.1 for drag which made the tank go upto the edge of field before orbitting. Increase the drag value if youu want the object to orbit earlier. This will however make the object lose velocity soon and spiral into the planet early.
Hope this article helped you.. Try my game https://play.google.com/store/apps/details?id=com.jaykalabs.atank1free