diff --git a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_PostureComponent.cpp b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_PostureComponent.cpp index bacdf46..bb600f4 100644 --- a/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_PostureComponent.cpp +++ b/Unreal/PS_AI_Agent/Plugins/PS_AI_ConvAgent/Source/PS_AI_ConvAgent/Private/PS_AI_ConvAgent_PostureComponent.cpp @@ -347,6 +347,8 @@ void UPS_AI_ConvAgent_PostureComponent::TickComponent( // ── Smoothed body yaw for cascade computations ────────────────── // Server: direct copy (no lag). Client: interpolate toward replicated // rotation to avoid step artifacts from discrete ~30Hz network updates. + // The client also overrides the actor's rotation with the smoothed value + // so the body mesh doesn't visually jump at network tick rate. if (Owner->HasAuthority()) { SmoothedBodyYaw = Owner->GetActorRotation().Yaw; @@ -356,6 +358,14 @@ void UPS_AI_ConvAgent_PostureComponent::TickComponent( const float ReplicatedYaw = Owner->GetActorRotation().Yaw; const float ClientDelta = FMath::FindDeltaAngleDegrees(SmoothedBodyYaw, ReplicatedYaw); SmoothedBodyYaw += FMath::FInterpTo(0.0f, ClientDelta, SafeDeltaTime, BodyInterpSpeed * 3.0f); + + // Override actor rotation with smoothed value so the body mesh + // shows the interpolated rotation instead of the raw replicated steps. + // This is local-only — replication will overwrite on next network update, + // and SmoothedBodyYaw will absorb the correction smoothly. + FRotator SmoothedRot = Owner->GetActorRotation(); + SmoothedRot.Yaw = SmoothedBodyYaw; + Owner->SetActorRotation(SmoothedRot); } // ── 3. Compute DeltaYaw after body interp ──────────────────────────