Animation goes undergound when scaling Capsule Component

Hi, i’m doing a slide for my 2.5D platform game, but when i use the Set Capsule Half Height it makes the sliding animation that i set goes underground, this doesn’t happen when i’m not using this node, any help?

Why do you need to adjust the half height of the character capsule on the slide?

It is making the animation go underground because the character is a child component of the capsule and when you shorten the half height you also basically raise the bottom of where your character is thought to end by the engine…
The bottom of the capsule is where the engine thinks the feet are as far as movement is concerned:

82795-shorterhalfheight.png

Causes:

That’s also why I asked why you need to shorten the half height of the Capsule.

1 Like

i need to make the character kinda like “crouch”, so it can pass under some obstacles, but i not been able to use the “crouch” and “uncrouch” nodes because i’m using it on the axis of the controller, so when i move the joystick down it makes the character crouch, so it is constantly updating.

you mean add a offset in the mesh inside de capsule on the blueprint?

Ok then you will need to setup a way to also offset the relative location of your character in the Z axis when you want to change the half height of the capsule…that’s the only way to not have the animations play underground as you can see by the images I posted.

Yeah like a set relative location and you will have to play with the numbers to get it just right but basically call something like this:

82915-relativelocation.png

or lerp to the location over a few delta seconds if you need to smooth it out more…to check what values you need to use in the BP’s viewport set the size in half height you need the capsule to be in and then move the character up in the Z to the point that his feet are at the bottom of the capsule the same as when it was at normal size…check the z location and start with that as the new relative location to play with and adjust…now set it back the way it was and add the nodes to fire both directions…one to size it down and move the mesh up and the other to size it back up and move the mesh down

i did a offset in the mesh position and now it is much better, i also attached the Spring Arm Component on the mesh so when i use the Crouch node it doesnt “shake” the camera when i crouch, now it only shakes the camera when the one controlling is the Set Capsule Half Height, i’m trying to find the value that it is changing but both the Spring Arm and the Camera don’t change values when i print then (even though the camera clearly moves on the viewport in the game) do you have any idea why this is happening?

The capsule is the root component when it is resized everything moves because the capsules pivot has moved…when you change the half height it lowers towards the ground

so i need to do an offset with the camera even though it didn’t change the values?

Yes you either have to offset the mesh with the camera attached to it or you’ll need to offset the camera in addition to your current offsets because when you resize the capsule it changes where your BP collides with the ground…here take a look at what I mean: