RealDocs

UKismetSystemLibrary::DrawDebugCone

function Engine Blueprint Deprecated Since 4.0
Deprecated: DrawDebugCone has been changed to use degrees for angles instead of radians. Place a new DrawDebugCone node and pass your angles as degrees.
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintCallable

Description

Draws a wireframe cone using angles in radians. Superseded by DrawDebugConeInDegrees, which is functionally identical but takes angles in degrees.

Caveats & Gotchas

  • • Deprecated in favor of DrawDebugConeInDegrees — the Blueprint node is marked DeprecatedFunction and placing it warns to switch nodes.
  • • AngleWidth/AngleHeight are in radians here, unlike almost every other angle parameter in this library which uses degrees — a common source of near-invisible or wildly oversized cones.
  • • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.

Signature

static void DrawDebugCone(const UObject* WorldContextObject, const FVector Origin, const FVector Direction, float Length, float AngleWidth, float AngleHeight, int32 NumSides, FLinearColor LineColor, float Duration = 0.f, float Thickness = 0.f)

Parameters

Name Type Description Default
WorldContextObject const UObject* World context used to resolve which world to draw in. —
Origin const FVector World-space apex of the cone. —
Direction const FVector Direction the cone points, from the apex. —
Length float Length of the cone from apex to base. —
AngleWidth float Half-angle of the cone in the horizontal plane, in radians. —
AngleHeight float Half-angle of the cone in the vertical plane, in radians. —
NumSides int32 Number of sides used to approximate the cone's base. —
LineColor FLinearColor Color of the drawn cone. —
Duration float How long the cone persists, in seconds. 0 draws for a single frame. 0.f
Thickness float Line thickness in screen pixels. 0.f

Return Type

void

Example

Draw a cone (prefer DrawDebugConeInDegrees instead) C++
UKismetSystemLibrary::DrawDebugCone(
    this,
    GetActorLocation(),
    GetActorForwardVector(),
    500.f,
    FMath::DegreesToRadians(30.f),
    FMath::DegreesToRadians(30.f),
    16,
    FLinearColor::Red,
    1.0f);

Version History

Introduced in: 4.0

Version Status Notes
5.6 deprecated Superseded by DrawDebugConeInDegrees.

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.