how to apply the gravity of a kinematicbody on a sphere?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By lalel345

I want that when the player moves to have gravity towards the center of the ball.
normally i do this.

var velocity = Vector2()
velocity.y = Vector3.DOWN * gravity

this only works when the terrain is linear

:bust_in_silhouette: Reply From: djmick

This video should help:

It had a lot of extra stuff but the idea is the same.