I'm building my first (space)game and its coming along great. I just added some physics to it which was surprisingly easy to do after a bit of reading. My planets now have gravity!
Atm i'm comparing 2 value's to see if the ship is in range for the force to take affect. Its working as intended however i would like the force to increase in strength as the ship gets closer to the planet.
I figured this could be done by dividing the force with the distance between the ship and the planet. That way the force would be lower if you are further away from the planet. The only thing is i have no idea how to set this up.
Here is a link to my test built