Walking on the surface of a sphere

Hello, I’m new to UE4, I’m trying to make a simple space simulation game which features a character walking on the surface of a planet. I have been searching and find that there are other people ask about this too, but can’t seem to find a good/complete solution. I could make the character to rotate and stick with the planet by adding velocity toward the planet when it’s close enough. But the character is always in the state of flying/jumping, I have no idea how to modify the part where the character gets input from the player to move and play the corresponding animation.

This is what I have got so far:

Thank you for reading, any help is much appreciated!

You should modify gravity direction otherwise the game would see it as launching the character against a wall or ceiling. You can calculate the gravity direction by subtracting player location. from the planet origin. You should also rotate your capsule component accordingly, which is a bit harder.

Are your planets small enough for the curvature to make a difference?