Is there a way to set the gravity to a single point (like at the center of a sphere) instead of just down?
You can only set gravity as a direction. If you want the direction to be different per object you will need to disable gravity altogether (from the scene tab or somewhere around there) and apply a force to each object using a script such as this:
import bge import mathutils point = mathutils.Vector([0,0,0]) def apply_gravity(cont): global point direction = cont.owner.worldPosition - point direction.magnitude = cont.owner.mass * 9.8 cont.owner.applyForce(direction)
Also - if you’re interested here’s a simple ‘n-body’ gravity script (basically the same as andrew-101’s) but loops through all objects for a solar system or something like that.