RealDocs

UKismetSystemLibrary::DrawDebugBox

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Draws a wireframe box for debugging, matching the way box collision or trace shapes are described by center, extent, and rotation.

Caveats & Gotchas

  • Extent is a half-extent, matching FBoxSphereBounds/BoxTrace conventions, not the full box dimensions.
  • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.

Signature

static void DrawDebugBox(const UObject* WorldContextObject, const FVector Center, FVector Extent, FLinearColor LineColor, const FRotator Rotation=FRotator::ZeroRotator, float Duration=0.f, float Thickness = 0.f, EDrawDebugSceneDepthPriorityGroup DepthPriority = EDrawDebugSceneDepthPriorityGroup::World)

Parameters

Name Type Description Default
WorldContextObject const UObject* World context used to resolve which world to draw in.
Center const FVector World-space center of the box.
Extent FVector Half-extents of the box along each local axis.
LineColor FLinearColor Color of the drawn box.
Rotation const FRotator Orientation of the box. FRotator::ZeroRotator
Duration float How long the box persists, in seconds. 0 draws for a single frame. 0.f
Thickness float Line thickness in screen pixels. 0.f
DepthPriority EDrawDebugSceneDepthPriorityGroup Whether the box is depth-tested against the scene or always drawn in the foreground. EDrawDebugSceneDepthPriorityGroup::World

Return Type

void

Example

Visualize a box trace region C++
UKismetSystemLibrary::DrawDebugBox(
    this,
    TraceCenter,
    FVector(50.f, 50.f, 50.f),
    FLinearColor::Green,
    TraceRotation.Rotator(),
    1.0f);

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.