Download

Pawn Crouching Issue

I encountered a issue I wasn’t aware was taking place until recently. I’m using the default UDK character and default animations but with a scale of 2.0(192UU). The character is floating in the air when I crouch. I researched and found some threads but still unclear if this is solvable. I can adjust the collision cylinder to match the height of the character in the crouch animation but then he floats way above the cylinder. He gets offset and if I adjust the crouch cylinder to match the player height well it minimizes the offset and he looks about right crouching but of course now he will collide with crouch height spaces in the world. I see Variables in UDK pawn for CrouchTranslationOffset and CrouchMeshZOffset but got weird results. Would the block of code in UDK Pawn and those Variables be the solution?

This thread below states the same issue but no solution at least posted.

https://forums.epicgames.com/showthread.php?770522-Character-is-floating-wile-crouching/page2&highlight=crouching+floating

it is solvable.in the pawn.uc,def props

bEnableFootPlacement=false
BaseTranslationOffset=5.0

adjust these 2 lines.its been a few years since I encountered it but im sure this is the fix.

Setting bEnableFootPlacement=false creates a smooth transition when the crouch is started but adjusting BaseTranslationOffset doesnt have any effect for me. What I did find is in UDK Pawn the StartCrouch Function. I made the below adjustment of setting CrouchMeshZOffset to 10 instead of HeightAdjust.

simulated event StartCrouch(float HeightAdjust)
{
OldZ -= HeightAdjust;
Super.StartCrouch(HeightAdjust);

//Offset mesh by height adjustment
//CrouchMeshZOffset = HeightAdjust; I commented this out and set CrouchMeshZOffset to 10 to which lands the character right on the ground
CrouchMeshZOffset = 10.0;

}

Not sure if it is an option for you;

  • drop the Skeletal Mesh on the Z-axis.
    6c27266fbd787f487a316820e317e9356a41ab9e.jpeg

If that is not an option (because maybe it breaks everything else), then maybe you can do the above but in 3Dsmax or blender, adjust the animation for crouch only.