CharacterMovementComponent has recently received support for custom gravity directions. Crouch logic needs to be updated to account for custom directions. Currently, crouching logic in CMC assumes Z-up, such as in encroach checks:
const bool bEncroached = GetWorld()->OverlapBlockingTestByChannel(UpdatedComponent->GetComponentLocation() - FVector(0.f,0.f,ScaledHalfHeightAdjust), FQuat::Identity,
UpdatedComponent->GetCollisionObjectType(), GetPawnCapsuleCollisionShape(SHRINK_None), CapsuleParams, ResponseParam);
and when snapping the component to its walkable base:
UpdatedComponent->MoveComponent(FVector(0.f, 0.f, -ScaledHalfHeightAdjust), UpdatedComponent->GetComponentQuat(), true, nullptr, EMoveComponentFlags::MOVECOMP_NoFlags, ETeleportType::TeleportPhysics);
When using non-default character gravity, observe that characters crouch and uncrouch without moving relative to their base. Observe that characters can crouch under obstructions and fail to uncrouch when they don't have clearance.
There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-207486 in the post.
0 |
Component | UE - Gameplay - Components |
---|---|
Affects Versions | 5.3 |
Target Fix | 5.5 |
Created | Feb 20, 2024 |
---|---|
Resolved | Mar 12, 2024 |
Updated | Jul 22, 2024 |