I actually found a free plugin for exactly that! "Directional and Planet Gravity"
I did want to challenge myself and try to code everything in house, which I did achieve in the end. But good to know something like that exists -v-