Draw Debug shapes in Unreal Engine 5 C++

Written on: 19 June 2025


Point

Point Draw Debug Shape Screenshot

DrawDebugPoint(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 100.0f),  // Location
    15.0f,                        // Point size
    FColor::Red,                  // Color
    false,                        // Persistent?             Default = false
    10.0f,                        // Life Time (Seconds)     Default = -1.f
    0                             // Depth Priority          Default = 0
);

Line

Line Draw Debug Shape Screenshot

DrawDebugLine(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 50.0f),   // Start location
    FVector(0.0f, 0.0f, 130.0f),  // End location
    FColor::Red,                  // Color
    false,                        // Persistent?             Default = false
    10.0f,                        // Life Time (Seconds)     Default = -1.f
    0,                            // Depth Priority          Default = 0
    0.f                           // Line Thickness          Default = 0.f
);

Sphere

Sphere Draw Debug Shape Screenshot

DrawDebugSphere(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 120.0f),  // Center location
    30.0f,                        // Radius
    12,                           // Segments
    FColor::Red,                  // Color
    false,                        // Persistant?             Default = false
    10.0f,                        // Life Time (Seconds)     Default = -1.f
    0,                            // DepthPriority           Default = 0
    0.f                           // Line Thickness          Default = 0.f
);

Box

Box Draw Debug Shape Screenshot

DrawDebugBox(
    GetWorld(),                    // World
    FVector(0.0f, 0.0f, 100.0f),   // Center location
    FVector(40.0f, 40.0f, 40.0f),  // Extent (Half length)
    FColor::Red,                   // Color
    false,                         // Persistent?           Default = false
    10.0f,                         // Life Time (Seconds)   Default = -1.f
    0,                             // Depth Priority        Default = 0
    0.0f                           // Line Thickness        Default = 0.f
);


// With Rotation
DrawDebugBox(
    GetWorld(),                          // World
    FVector(0.0f, 0.0f, 100.0f),         // Center location
    FVector(40.0f, 40.0f, 40.0f),        // Extent (Half length)
    FQuat(FRotator(0.0f, 45.0f, 0.0f)),  // Rotation
    FColor::Red,                         // Color
    false,                               // Persistent?           Default = false
    10.0f,                               // Life Time (Seconds)   Default = -1.f
    0,                                   // Depth Priority        Default = 0
    0.0f                                 // Line Thickness        Default = 0.f
);

Solid Box

Solid Box Draw Debug Shape Screenshot

DrawDebugSolidBox(
    GetWorld(),                    // World
    FVector(0.0f, 0.0f, 100.0f),   // Center location
    FVector(30.0f, 30.0f, 30.0f),  // Extent (Half length)
    FColor::Red,                   // Color
    false,                         // Persistent?          Default = false
    10.0f,                         // Life Time (Seconds)  Default = -1.f
    0                              // Depth Priority       Default = 0
);


// With Rotation
DrawDebugSolidBox(
    GetWorld(),                          // World
    FVector(0.0f, 0.0f, 100.0f),         // Center location
    FVector(30.0f, 30.0f, 30.0f),        // Extent (Half length)
    FQuat(FRotator(0.0f, 45.0f, 0.0f)),  // Rotation
    FColor::Red,                         // Color
    false,                               // Persistent?          Default = false
    10.0f,                               // Life Time (Seconds)  Default = -1.f
    0                                    // Depth Priority       Default = 0
);


// Using FBox & FTransform
DrawDebugSolidBox(
    GetWorld(),                                         // World
    FBox(FVector(-30, -30, 70), FVector(30, 30, 130)),  // Box (Min location, Max location)
    FColor::Red,                                        // Color
    FTransform::Identity,                               // Transform            Default = FTransform::Identity
    false,                                              // Persistent?          Default = false
    10.0f,                                              // Life Time (Seconds)  Default = -1.f
    0                                                   // Depth Priority       Default = 0
);

Cone

Cone Draw Debug Shape Screenshot

DrawDebugCone(
    GetWorld(),                      // World
    FVector(0.0f, 0.0f, 150.0f),     // Origin location
    FVector(0.0f, 0.0f, -1.0f),      // Direction
    75.0f,                           // Length
    FMath::DegreesToRadians(30.0f),  // Angle width (Radians)
    FMath::DegreesToRadians(30.0f),  // Angle height (Radians)
    12,                              // Segments
    FColor::Red,                     // Color
    false,                           // Persistent?          Default = false
    10.0f,                           // Life Time (Seconds)  Default = -1.f
    0,                               // Depth Priority       Default = 0
    0.0f                             // Line Thickness       Default = 0.f
);

Capsule

Capsule Draw Debug Shape Screenshot

DrawDebugCapsule(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 100.0f),  // Center location
    50.0f,                        // Half height
    20.0f,                        // Radius
    FQuat::Identity,              // Rotation
    FColor::Red,                  // Color
    false,                        // Persistent?             Default = false
    10.0f,                        // Life Time (Seconds)     Default = -1.f
    0,                            // Depth Priority          Default = 0
    0.0f                          // Line Thickness          Default = 0.f
);

Cylinder

Cylinder Draw Debug Shape Screenshot

DrawDebugCylinder(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 50.0f),   // Start location
    FVector(0.0f, 0.0f, 150.0f),  // End location
    30.0f,                        // Radius
    12,                           // Segments
    FColor::Red,                  // Color
    false,                        // Persistent?             Default = false
    10.0f,                        // Life Time (Seconds)     Default = -1.f
    0,                            // Depth Priority          Default = 0
    0.0f                          // Line Thickness          Default = 0.f
);

Crosshairs

Crosshairs Draw Debug Shape Screenshot

DrawDebugCrosshairs(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 130.0f),  // Location
    FRotator::ZeroRotator,        // Rotation
    50.0f,                        // Scale
    FColor::Red,                  // Color                  Default = FColor::White
    false,                        // Persistent?            Default = false
    10.0f,                        // Life Time (Seconds)    Default = -1.f
    0                             // Depth Priority         Default = 0
);

Coordinate System

Coordinate System Draw Debug Shape Screenshot

DrawDebugCoordinateSystem(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 100.0f),  // Location
    FRotator(0.0f, 0.0f, 0.0f),   // Rotation
    50.0f,                        // Scale
    false,                        // Persistent?            Default = false
    10.0f,                        // Life Time (Seconds)    Default = -1.f
    0,                            // Depth Priority         Default = 0
    2.0f                          // Line Thickness         Default = 0.f
);

Directional Arrow

Directional Arrow Draw Debug Shape Screenshot

DrawDebugDirectionalArrow(
    GetWorld(),                   // World
    FVector(0.0f, 0.0f, 50.0f),   // Start location
    FVector(0.0f, 0.0f, 130.0f),  // End location
    30.0f,                        // Size
    FColor::Red,                  // Color
    false,                        // Persistent?          Default = false
    10.0f,                        // Life Time (Seconds)  Default = -1.f
    0,                            // Depth Priority       Default = 0
    1.0f                          // Line Thickness       Default = 0.f
);

Solid Plane

Solid Plane Draw Debug Shape Screenshot

DrawDebugSolidPlane(
    GetWorld(),                         // World
    FPlane(FVector::UpVector, 120.0f),  // Plane
    FVector(0.0f, 0.0f, 120.0f),        // Center Location
    50.0f,                              // Size
    FColor::Red,                        // Color
    false,                              // Persistent?          Default = false
    10.0f,                              // Life Time (Seconds)  Default = -1.f
    0                                   // Depth Priority       Default = 0
);


// Using Extent
DrawDebugSolidPlane(
    GetWorld(),                         // World
    FPlane(FVector::UpVector, 120.0f),  // Plane
    FVector(0.0f, 0.0f, 120.0f),        // Center Location
    FVector2D(100.0f, 50.0f),           // Extent (Half length)
    FColor::Red,                        // Color
    false,                              // Persistent?          Default = false
    10.0f,                              // Life Time (Seconds)  Default = -1.f
    0                                   // Depth Priority       Default = 0
);