Download

CHARACTER CLASS: How to move the root "CapsuleComponent" ref pivot down?

Hi…

Today while using MyCharacterClass->GetActorLocation( ) I’ve seen that it returns a vector with the height of my character pelvis instead of the ground height (foot).

I noticed that this can be happening due to my root component being a CapsuleComp, whose reference location is the halfheight.

Is there any way from change the reference point from my character to his foot without change my root comp to other thing than not the capsule? How?

Thank you.

You can get the location of the capsule bottom as follows:



FVector bottomOfCapsule = MyCharacterClass->GetActorLocation();
bottomOfCapsule.Z -=  MyCharacterClass->CapsuleComponent->GetScaledCapsuleHalfHeight();


If you watch the Character BP Assembling video, you’ll notice the instructor moving the capsule component upwards keeping the character pivot on ground.

Of course on “last case” your method would do the job staticvoidlol, but there should be a way to do this without override the GetActorLocation( ) method or writing a method to change result as you suggested, probably something on CapsuleComponent creation or initialization. I just can’t find what… :frowning:

A link to the video would be nice.