How do I make a gravity code

Hello! I’m planning to make a very realistic space simulator, but I’m having difficulties with the physics part, how do I make code about gravity? I would like to use the equation F = G m1.m2/r2 in which depending on the mass of the object or model, the player would be attracted by gravity, the mass could be a variable, and in empty spaces the gravity would be zero, anyway, please help me, thanks

-Foxy

Make a script that calculates the gravitational force between the player (or object) and a celestial body based on their masses and distance, applying a force to the player to simulate gravity. Xx

1 Like

But how do I do it? Do I use vector3?