hi I am making a game like angry bird space, I created a planet and tried to change the space gravity vector according to the position of the star. but it doesn't work

then i used the difference vector for the position of planet and star for the revolution of planet it worked but i have so many things associated with one star if i how should i define the space gravity to give real space effect?