UKismetSystemLibrary::DrawDebugConeInDegrees
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Draws a wireframe cone with angles specified in degrees, commonly used to visualize a field-of-view or perception cone.
Caveats & Gotchas
- • In the Blueprint palette this node's DisplayName is just "Draw Debug Cone" — it replaces the older radians-based DrawDebugCone, which still exists in C++ under its own name.
- • AngleWidth and AngleHeight are half-angles, so a 90-degree total field of view means passing 45 for both, not 90.
- • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.
Signature
static void DrawDebugConeInDegrees(const UObject* WorldContextObject, const FVector Origin, const FVector Direction, float Length=100.f, float AngleWidth=45.f, float AngleHeight=45.f, int32 NumSides = 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. | — |
| 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. | 100.f |
| AngleWidth | float | Half-angle of the cone in the horizontal plane, in degrees. | 45.f |
| AngleHeight | float | Half-angle of the cone in the vertical plane, in degrees. | 45.f |
| NumSides | int32 | Number of sides used to approximate the cone's base. | 12 |
| LineColor | FLinearColor | Color of the drawn cone. | FLinearColor::White |
| 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 |
| DepthPriority | EDrawDebugSceneDepthPriorityGroup | Whether the cone is depth-tested against the scene or always drawn in the foreground. | EDrawDebugSceneDepthPriorityGroup::World |
Return Type
void Example
Visualize a perception cone C++
UKismetSystemLibrary::DrawDebugConeInDegrees(
this,
GetActorLocation(),
GetActorForwardVector(),
800.f,
60.f,
45.f,
24,
FLinearColor::Green,
0.f); See Also
Tags
Version History
Introduced in: 4.9
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?