In an environment where the custom gravity with the CMC now has support for is used, and the capsule is not necessarely Z-up, the associated debug calls which the CMC makes with
DrawDebugCapsule(
are still facing Z-up as they are using FQuat:Identity
The debug calls happen in
UCharacterMovementComponent::OnClientCorrectionReceived and UCharacterMovementComponent::ServerMoveHandleClientError
A solution to this would be to use
UpdatedComponent->GetComponentQuat() instead of FQuat:Identity in UCharacterMovementComponent::ServerMoveHandleClientError
And for
UCharacterMovementComponent::OnClientCorrectionReceived
something like
const FQuat ClientRotAtCorrectedMove = ClientData.LastAckedMove.IsValid() ? ClientData.LastAckedMove->SavedRotation.Quaternion() : UpdatedComponent->GetComponentQuat(); const FQuat CapsuleOrientation = UpdatedComponent->GetComponentQuat(); if (!LocDiff.IsNearlyZero()) { // When server corrects us to a new location, draw red at location where client thought they were, green where the server corrected us to DrawDebugCapsule(GetWorld(), ClientLocAtCorrectedMove, CharacterOwner->GetSimpleCollisionHalfHeight(), CharacterOwner->GetSimpleCollisionRadius(), ClientRotAtCorrectedMove, FColor(255, 100, 100), false, DebugLifetime); DrawDebugCapsule(GetWorld(), NewLocation, CharacterOwner->GetSimpleCollisionHalfHeight(), CharacterOwner->GetSimpleCollisionRadius(), CapsuleOrientation, FColor(100, 255, 100), false, DebugLifetime); } else { // When we receive a server correction that doesn't change our position from where our client move had us, draw yellow (otherwise would be overlapping) // This occurs when we receive an initial correction, replay moves to get us into the right location, and then receive subsequent corrections by the server (who doesn't know if we corrected already // so continues to send corrections). This is a "no-op" server correction with regards to location since we already corrected (occurs with latency) DrawDebugCapsule(GetWorld(), NewLocation, CharacterOwner->GetSimpleCollisionHalfHeight(), CharacterOwner->GetSimpleCollisionRadius(), ClientRotAtCorrectedMove, FColor(255, 255, 100), false, DebugLifetime); }
Should be able to keep the same functionality