Gameplay Debugger HUD disappears when spectator mode (debug camera) is toggled

Summary

When the Gameplay Debugger’s spectator extension is turned on, the debugger’s canvas HUD (the header and category text) stops drawing. This makes the spectator extension close to useless for inspecting AI from a detached camera.

Questions for Epic

  1. Is this a known issue, and is there a fix upstream or planned?
  2. Is this the approach you’d recommend, or would you rather it be fixed another way? For example, the check could compare the ULocalPlayer, or the extension could pass the original controller.
  3. Would you take this upstream so we can drop the engine mod?

[Attachment Removed]

Steps to Reproduce
Steps to reproduce

  1. Start PIE or a standalone game on any map with an AI pawn.
  2. Open the Gameplay Debugger (default key: ') and turn on any category, such as AI or Perception.
  3. Toggle the spectator extension (default key: Tab).
  4. The HUD disappears. Toggle spectator off and it comes back.

Expected: The HUD keeps drawing while the debug camera is active.

Actual: Nothing is drawn on the canvas for as long as the debug camera is active.

Cause

OnDebugDraw checks the owner so that multiplayer PIE and split-screen work:

if (PlayerController != nullptr && CachedReplicator->GetReplicationOwner() != PlayerController)
{
    return;
}

The spectator extension spawns an ADebugCameraController, and OnActivate switches the local player over to it. After that, UDebugDrawService::Draw is called with the debug camera controller rather than the replicator’s owner, so the check fails and the function returns early.

Local fix (our engine mod)

if (PlayerController != nullptr && CachedReplicator->GetReplicationOwner() != PlayerController)
{
    const ADebugCameraController* SpectatorPC = Cast<ADebugCameraController>(PlayerController);
    if (SpectatorPC == nullptr || SpectatorPC->OriginalControllerRef != CachedReplicator->GetReplicationOwner())
    {
        return;
    }
}

This treats a debug camera as its original controller. The per-owner filtering for split-screen and multiplayer PIE still works, because each debug camera only matches the replicator whose owner it took over from. Engine/DebugCameraController.h is already included in this file.

[Attachment Removed]

This was just something that was not added at the time. I submitted CL 59516347 today in UE5 Main to add the Gameplay Debugger HUD functionality to the Spectator. This means you can watch values, toggle categories, and change selected Pawns while using the Spectator.

-James

[Attachment Removed]