RealDocs

UKismetSystemLibrary::DrawDebugCylinder

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

Description

Draws a wireframe cylinder between two points, useful for visualizing capsule collision without the hemisphere caps or a custom volume shape.

Caveats & Gotchas

  • Start and End define the centers of the two flat caps, so the cylinder's total height is the distance between them — it does not take a separate height parameter.
  • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.

Signature

static void DrawDebugCylinder(const UObject* WorldContextObject, const FVector Start, const FVector End, float Radius=100.f, int32 Segments=12, 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.
Start const FVector World-space center of one cap of the cylinder.
End const FVector World-space center of the other cap of the cylinder.
Radius float Radius of the cylinder. 100.f
Segments int32 Number of segments used to approximate the circular cross-section. 12
LineColor FLinearColor Color of the drawn cylinder. FLinearColor::White
Duration float How long the cylinder persists, in seconds. 0 draws for a single frame. 0.f
Thickness float Line thickness in screen pixels. 0.f
DepthPriority EDrawDebugSceneDepthPriorityGroup Whether the cylinder is depth-tested against the scene or always drawn in the foreground. EDrawDebugSceneDepthPriorityGroup::World

Return Type

void

Example

Draw a vertical cylinder C++
const FVector Base = GetActorLocation();
UKismetSystemLibrary::DrawDebugCylinder(
    this,
    Base,
    Base + FVector(0, 0, 200.f),
    50.f,
    16,
    FLinearColor::Blue,
    2.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.