Gravitational pull orientated around sphere

I have an idea. I have been thinking of makeing a game with a planetary system, in which the globes have two collisions, one a child of the planet without rigid body, and the other the surface of the globe with rigid body. I have a FPS script and I want the player to be seen with the bottom of the player to touch the surface.

My issue is that I need someone to help add the gravity to the globe, and make sure it works well.

Thanks in advance.

Hi @Imarri and welcome,

For something like that if you’d like to go with physics, the most straightforward solution is to disable gravity in your project settings (set it to 0,0,0). And start calculating a planet wide gravity force.

That would work by iterating through all of your rigid bodies and applying a force directed from the body towards the globe center.