I’m making a top down space shooter that involves orbiting around planets at high velocities. I need to make it so that the amount of gravitational pull a planet has is translated directly to the mass of the planet and the mass of the object that it is pulling. I also need to make it so the character won’t hit the planets unless they are traveling directly at them above a certain velocity. If they’re below this velocity, gravitational pull will deflect their trajectory into the orbit of that planet or another planet.
I know the standard equation for this is Fg = G (m1 * m2 ) / r^2…but as an artist I’m not sure how to get that into scripting reliably.
Any suggestions?