Best practice? (Capsule and Character Class, Hierarchy and Position)

Whenever I make a new character, I am torn between what is the best way to go about setting the hierarchy.

On one hand, I have been told countless time (exaggeration) that the best practice is to have the capsule component as the root of the character. However, when it is, I lose access to place the character feet at height zero

Its either I mess around adding the half height of the capsule later whenever it want to move the pawn around (example teleporting) or I resolve to put the capsule as a child of a dummy.

I feel both solution inelegant and wonder If I just missed the tree in the forest.
Any advise for me ?

Forgive me if I am missing something here or maybe do not quite understand what you are asking but the short answer is, the first solution is the standard and generally best way to structure a character. This makes locomotion simpler and more efficient, because at its simplest, the capsule drives and the animation is simply reacting to that velocity. It also makes collision much more efficient (albeit imprecise).

In the example you offered regarding teleporting I assume you are referring to the issue of the pivot being in the centre of the capsule and having to offset the location by the half height of the capsule when setting its new location? If the mesh is a child of the capsule then the offset will always be maintained relative to the capsule but as far as having the pivot at the feet of capsule, if you are inheriting from the standard UE Character class then I don’t really have a solution, as the hierarchy is inherited and is fixed.

However if you are rolling your own character from scratch (which I assume you must be if talking custom hierarchy?) then there is nothing to stop you putting something else above the capsule as the root and then the capsule can be offset permanently by its half-height allowing for a pivot point at the bottom?

You’re right in that both solutions are inelegant for specific things but can work well for others. I guess I would say that the standard hierarchy is generally the best option until it isn’t. If you are finding it is not working for you, then roll a more bespoke solution that fits your project.

1 Like

Exactly, It not preventing me of anything but I felt this was at odd with the rest of the generally well taught out state of the engine. I asked because I just wanted to be certain there no options I didn’t knew about.

I could probably spend a lot more time and fiddle with a custom movement component that is more tailored but that overkill for what I do.

Thanks you for the reply!

1 Like