RealDocs

UKismetSystemLibrary::DrawDebugCapsule

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

Description

Draws a wireframe capsule, matching the shape and parameters (center, half-height, radius, rotation) used by capsule collision components and capsule traces.

Caveats & Gotchas

  • HalfHeight is the distance from the center to the tip of each hemisphere cap, the same convention as UCapsuleComponent — it is not the height of the cylindrical section alone.
  • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.

Signature

static void DrawDebugCapsule(const UObject* WorldContextObject, const FVector Center, float HalfHeight, float Radius, const FRotator Rotation, FLinearColor LineColor = FLinearColor::White, 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 capsule.
HalfHeight float Distance from the center to the tip of each hemisphere cap.
Radius float Radius of the capsule.
Rotation const FRotator Orientation of the capsule.
LineColor FLinearColor Color of the drawn capsule. FLinearColor::White
Duration float How long the capsule persists, in seconds. 0 draws for a single frame. 0.f
Thickness float Line thickness in screen pixels. 0.f
DepthPriority EDrawDebugSceneDepthPriorityGroup Whether the capsule is depth-tested against the scene or always drawn in the foreground. EDrawDebugSceneDepthPriorityGroup::World

Return Type

void

Example

Visualize a capsule trace shape C++
UKismetSystemLibrary::DrawDebugCapsule(
    this,
    TraceCenter,
    88.f,
    34.f,
    FRotator::ZeroRotator,
    FLinearColor::Green,
    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.