How can I give a sphere its own gravity?

I have seen this done in unity but noting like I want in unreal. I am thinking somehow make a procedural planet like minecraft but not blocky and on a sphere. can anyone help?

Hello, jampakdd.

UE4 has its own gravity function, located in UE4/Engine/Source/Runtime/Engine/Private/PhysicsEngine/PhysLevel.cpp If you’re experienced with C++, you could probably edit this file to make gravity work for a large sphere like you intend.

If you aren’t experienced with C++, you could simply disable gravity and create your own gravity function using blueprints. You would need to align the gravity so that it pulls the character (and any objects) towards the center of the sphere, but that should be reasonably simple once you get into it.

If you want to know more about the way Gravity is set up in UE4, I recommend looking into this forum thread:

Good luck,

Jonathan Dorman

This looks like exactly what I need thank you!