I just thought actually, well I had Super Mario Galaxy in mind, touching won't work as you need to detect gravity pull while in the air. With touching you won't be able to leave the planet you're on so I would set up a gravitational field, like a sprite that surrounds the object but is invisible and if the player comes into contact with this then it takes the gravity angle of the relevant object. If the player is outside any gravity field then you set the angle of gravity to default so the player can just jump normally between planets. In my head this works, erm have fun! : D