UCDebugComponent

Overview

Debug overlay widget attached to actors. Extends UWidgetComponent, implements ICDebugComponent_ and ICPlayerControllerBoundable. Created by UCInitializerComponent::prepare_CSTR_* for all base classes. Displays a world-space or screen-space debug widget using the W_DEBUG widget class from the coordinator.

Properties & Methods

Name Description
debugWidgetClass Widget class retrieved from CoordinatorUtility::retrieveWidget(ECWidget::W_DEBUG)
commonDetailInformation Shared UCActorInformation reference
interactionComponent Reference to the owning actor’s UCInteractionComponent (used for capsule height positioning)
init Creates the debug widget, configures world-space or screen-space rendering, binds to player controller events
reset Reserved for future use (currently empty)
addDebugWidgetWith Delegates to ICDebugWidget_::addDebugWidgetWith — adds a custom TFunction<FText(AActor*)> debug line
onPerspectiveTypeChange Responds to camera perspective changes (FIRT_VIEW / TOP_VIEW)
boundDynamic / unboundDynamic Binds/unbinds to ACPlayerController perspective events
// UCDebugComponent is created automatically by UCInitializerComponent.
// On init, it retrieves the W_DEBUG widget class from the coordinator,
// creates the widget, and configures its display mode:
//   - If the widget implements ICWorldWidget_: world-space with transform, drawSize, material
//   - Otherwise: screen-space positioned at capsule half-height

// Adding custom debug text:
ICDebugComponent_* debug = Cast<ICDebugComponent_>(debugComponent);
debug->addDebugWidgetWith([](AActor* actor) {
    return FText::FromString(FString::Printf(TEXT("HP: %d"), GetLife(actor)));
});