Moving the CapsuleComponent - starts at feet?

Hi all,

We’ve noticed (as seen in the image) that when you create a character blueprint, it automatically adds a CapsuleComponent to the components list. We’ve also noticed that the capsule looks to be centered by its object center then put to the 0,0,0 point on the grid, which means half the capsule is through the floor. We can’t seem to find a way to move the capsule to fit the character.

As an easy solution we’ve just moved our characters down to match the component, but this seems like a very odd practice. Is this intended? If so, is there a purpose? We like learning. :slight_smile:

Thanks!

“As an easy solution we’ve just moved our characters down to match the component, but this seems like a very odd practice.”

Yes that is the correct thing to do!

You should expect to have to do this :slight_smile:

You can increase the dimensions of the capsule to fit larger characters and then adjust the Character Mesh relative offset till the feet are at the bottom of the capsule

:slight_smile:

Rama

Thanks Rama!

It wasn’t causing us any problems, but it’s something we felt was odd and it happened at the root of our character and animation pipeline, so we wanted to make sure we were doing it right before it caused a ripple effect and we had to redo animations or the rig or something.

I don’t wanna look stupid but we are actually moving on from Unity Engine professionals into Unreal Engines starting up! so in my old days, the player capsule should be first zeroed on the ground (the capsule bottom edge is at level 0 with ground) then we adjust the player inside it because this capsule in Unity means collide for physics and you don’t really wanna walk with you entire lower half inside the terrain! :smiley: but that was in unity… now even that I know this capsule is not a collide nor related to physics but I see no reason to leave it half sunk on the floor level 0 like that, I mean shouldn’t we adjust it first to float on the floor as long as we have the option now in UE4.8? or it really doesn’t matter? I think I need a little bit of understanding what is the really purpose and editing effects of this player capsule. thanks in advance!

1 Like

I know this is an ancient thread, but I still don’t understand the answer. The capsule component of a character is still centered at 0, 0, 0 in ue4.15. What’s the point of having a “floor” in the blueprint viewport editor if it’s supposed to go through the middle of everything? The floor should be a guide for ensuring your components are set up right so that character will standing on top of whatever surface you want it to stand on, not just an axis plane…

3 Likes

Trying to learn ue4 right now and I totally agree, while I am totally fine with this working as intended, showing the grid/‘floor’ in the blueprint editor as going half way through the capsule is incredibly confusing and looks like it’s straight up set up wrong

An example with the full ‘solid’ floor turned on for clarity: https://i.imgur.com/H11gtYj.png - of course I’ve moved my mesh into it and when placing it in the world it’s totally fine, but in the editor this is pretty confusing and does look as if it would cause issues

1 Like

The capsule origin makes even less sense when you realize that crouching changes the world location and many components attached to the capsule have to be moved.

If there can’t be an option to use the bottom as the origin then there should at least be a second capsule component available with that capability.

And if an old thread is still relevant then it’s fair game, IMO, and this will continue to be an issue until it’s addressed.

1 Like

So I decided to take my own advice and I managed to get a character with its origin at its feet. I didn’t need to change the engine source and it seems to work well, but I haven’t tested every aspect of character movement. I know it works on standalone and online multiplayer. I know it handles walking, crouching, and falling. I can’t speak to the other mechanisms (e.g. flying, swimming). I can’t make any guarantees that all my changes were right nor am I certain I did not introduce bugs. Time will tell.

The project contains two components: GroundCapsuleComponent and GroundMovementComponent. Use those instead of the standard components and your character will get its origin where the capsule meets the ground.

is a git of the project. You can use the two components in your own project, but make sure you change “CAPTEST_API” in the class declarations to your project’s “…_API” name.

I’d love it if this got used and improved. My only request is that you share your improvements by updating my git. And if someone wants to get this into the engine, that would be great.

[1]:

Update: Some other classes assume the actor origin is in the middle of the capsule. It’s mostly the AI stuff. The main problem right now is that UNavMovementComponent::GetActorFeetLocation isn’t virtual. I had to edit the source to override it. It’s interesting though, I’m just doing this for completion. My game did not have any noticeable effect when using the original functionality. My players and AI all work the same as they did with the original components.

Also worth noting that using this ground-based origin, my code got a lot cleaner. I honestly can’t imagine why anyone would have started with the capsule-center origin method in the first place. It takes extra work to accommodate it.

2 Likes

Hi! I’m interested in your solution. Do you still have it available somewhere? The github project is not availble anymore.

Can anyone suggest a way to change this and make the collider pivot at its bottom instead of in its center? I have multiple meshes with pivot at the feet and if the character height changes this would require manual adjustment each time.

Hello, can you share that file to me? I need to change centre of my capsule component.