Change Capuse half height creating a smooth transition (c++. FPS)

Trying to smoothly transition from standing to crouch. The animation works just fine, but setting the half-height directly alway makes the movement jagged.

Is there a way to set the half-height without it trembling during the change?

Blueprint or C++ ?

and I guess from that you probably know where this is going…

If C++, yes you can fix it. See this tutorial, or jump straight to the source.

I’ve only been playing with the engine for a few months myself and could be wrong, but I don’t believe this can be fixed in BP; the function overridden in that tutorial is not exposed to Blueprint, so that avenue is closed, maybe there is some other way to do it :person_shrugging:

c++

I’ve tried to do it my way, but isn’t working. I solved it temporarely with a timeline in BP, but noW the problem is changing the location of the character so that is doesn’t get stuck in the floor.

BTW, I should have mentioned it before but my problem is with First Person Camera.

I’m not aware of any reason you can’t use PlayerCameraManager in first person ?

Seems like it should work to me.

Because the camera is attached to a socket, and putting my hands on the camera suring the montage might ruin it.

I ended up solving it with Timeline & Offsets.
Another things that worked is putting the transition aniimation into the State Machine, but that might end up being too confusing.

We don’t smooth interp the capsule size, but we do have StartCrouch() and StopCrouch() events where crouch related stuff like move modifier is set.

A pretty straight forward thing to do is add a “CrouchState” enum and LERP your capsule size when crouching or uncrouching.

StartCrouch() and StopCrouch() events would be where you kick off the LERP.

1 Like