My purpose is just make the character walk along the chosen surfaces, and I want that specific surfaces to be surrounded by thin gravity fields, at least this is what I have imagined. Those specific surfaces will be alot and they will be close to each other and those complex shaped gravity fields must not overlap with each other. Is this possible? Lik for example making a gravity field in box shape, or a more complex shape like lets say a pyramid
Hey just find out I was overcomplicating things. I can just create actors with "coplex” shaped collisions and an arrow to set the gravity direction, and when character (or a specific collision attached to the character) overlaps with the collision in question, the gravity will be modified as the direction of arrow, or the exact opposite.
I will keep the question just in case, mabe someone help me or someone else by giving better ideas.
Indeed gravity is just a force, you could make blueprintable component that handles it all.
Actually you gave me idea for my game, how to make adjustable gravity inside my space stations.
So blueprintable component, that tracks some tags in which type volume it is and depending on volume name (or gameplay tag it has) it would calculate proper strength and direction of gravity.
This way you can make big volume that simulates centrifugal gravity in cylinder space station. Add some other “local” gravity zone with different volume priority and in that local volume gravity component can calculate different direction and gravity strength.
Such setup would let also changes in gravity during runtime.
a way to create a complex collision volume without creating a new derivative of UShapeComponent:
take a StaticMesh, could be any static mesh really, disable its renderer, by Enabling “Is Hidden in Game” then under its collision response change it to “Generate Overlap Events”
if you want it to exactly match the volume, you can even use the exact same static mesh for the collider, but scale it up by a little bit.
there are some caveats depending on how “complex” we are talking about, for the best collision response you would want the vast majority if not the entire volume to be Convex, or flat, otherwise LineTrace can give false positives, and the fewer faces to test against the better which might require simplifying the geometry.
the hardest part is obtaining the Normal vector of the surface (negative of the normal vector is gravity in many cases) that can get tricky without getting vertex data from the static mesh, which can be slow, but the Navigation system could be quarried in that instance.