p.NetShowCorrections on the CMC shows Z up capsules when corrections occur

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::OnClientCorrectionReceivedsomething 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

Steps to Reproduce
use p.NetShowCorrections in a project where the CMCs custom gravity is in use.

Play as a client in a build or PIE, in a scenario where the CMC’s updated component is rotated in a non Z up manner.

Get a network correction to occur, which can happen often when you land from a falling state.

Observe that the capsule debug showing the corrections is still facing Z up and not representing the character’s orientation

Hi,

Thank you for the report and the proposed fix! I can also observe the behavior described here, and I’ve opened a new issue, UE-298420, which should be visible in the public tracker in a day or so.

Thanks,

Alex