moving the CapsuleComponent - starts at feet?
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. :)
asked Mar 11 '14 at 05:40 AM in Everything Else
ue4-archive ♦♦ STAFF
"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 :)
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
answered Mar 11 '14 at 05:40 AM
ue4-archive ♦♦ STAFF
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.
Here 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.
answered Feb 14 '18 at 06:09 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here