Add diagnostic logs to OnRep_ConversationState for head tracking debug

Logs NetConversatingPawn, PostureComponent availability, and TargetActor
assignment to diagnose why head tracking doesn't work on remote clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
j.foucher 2026-03-02 15:26:28 +01:00
parent 0124de8b53
commit daf79d0d89

View File

@ -1213,6 +1213,14 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::OnRep_ConversationState()
{
AActor* Owner = GetOwner();
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Log,
TEXT("[NET-REP] OnRep_ConversationState — bNetIsConversing=%s NetConversatingPawn=%s NetConversatingPlayer=%s Owner=%s Role=%d"),
bNetIsConversing ? TEXT("true") : TEXT("false"),
NetConversatingPawn ? *NetConversatingPawn->GetName() : TEXT("NULL"),
NetConversatingPlayer ? *NetConversatingPlayer->GetName() : TEXT("NULL"),
Owner ? *Owner->GetName() : TEXT("NULL"),
static_cast<int32>(GetOwnerRole()));
if (Owner)
{
// Update posture target on all clients so the NPC head/eyes track the
@ -1228,13 +1236,24 @@ void UPS_AI_ConvAgent_ElevenLabsComponent::OnRep_ConversationState()
Posture->TargetActor = NetConversatingPawn;
Posture->ResetBodyTarget();
Posture->bEnableBodyTracking = true;
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Log,
TEXT("[NET-REP] Posture TargetActor set to %s"), *NetConversatingPawn->GetName());
}
else
{
Posture->TargetActor = nullptr;
Posture->bEnableBodyTracking = false;
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Warning,
TEXT("[NET-REP] Posture TargetActor cleared — bNetIsConversing=%s Pawn=%s"),
bNetIsConversing ? TEXT("true") : TEXT("false"),
NetConversatingPawn ? TEXT("valid") : TEXT("NULL"));
}
}
else
{
UE_LOG(LogPS_AI_ConvAgent_ElevenLabs, Warning,
TEXT("[NET-REP] PostureComponent NOT FOUND on %s"), *Owner->GetName());
}
// Activate/deactivate facial expressions and lip sync for remote clients.
// On the server, this is handled by OnAgentConnected/OnAgentDisconnected,