How can I make character walk above sphere planet or planets with terrain and atmosphere?

like this:

it is hard to make like this in unreal engine 4 by blueprint and c++?

Yeah that would take some coding. This topic is often discussed on Unity forums. Most of the same problems will be redundant here. If its a perfect sphere, then you can create vector from your Pawn to center of gravity. This is your Up vector for your Pawn. You can invert this vector to be your ‘gravity’ vector.

If its’ not a perfect spheriod then it gets trickier. You’d have to cast a ray to detect the normal the Pawn is standing on. It might get tricky if the Pawn is straddling multiple surface normal this all depends on how the raycast code works. You might be fine with the Hit normal it returns. You use the hit normal’s direction to align your character.

So yeah, it will require a small bit of movement code. Also, you’ll want to be careful to avoid gimbal lock so use Quaternions as a precaution. Avoid adding directly into a Rotator (plus avoid adding to roll/yaw/pitch directly).

It’s not exactly a trivial feature thus why you see so few games using this technique. Good Luck

how to make this code by blueprint?
or c++
or with c++ and blueprint?

Is there any documents can help me to start?plz
and thank you for help.