RuntimePrimitiveDrawing (RuntimeDrawing) Blueprint Nodes — Usage Guide
English | 简体中文
This document explains how to use the Blueprint-callable nodes provided by URuntimeDrawingBlueprintLibrary: what each node does, what its parameters mean, and common pitfalls.
1) Finding the nodes in Blueprints
- Make sure the plugin/module is enabled and compiled (module name:
RuntimePrimitiveDrawing). - In any Blueprint graph (Actor / Character / Controller / etc.):
- Right-click empty space
- Search for category: RuntimeDrawing
- Nodes are named
Draw...(e.g.,DrawLine,DrawBox,DrawFOVSector)
All functions use
meta = (WorldContext="WorldContext").
In Blueprints, the World Context is usually auto-provided from the calling Blueprint, so you typically don’t need to wire it manually.
2) Common parameter meanings (most nodes)
- WorldLocation / StartLocation / EndLocation: World-space positions.
- WorldRotation: World-space orientation (affects direction/shape orientation).
- Color (FLinearColor): Line/point color (linear color).
- Thickness (float): Line thickness.
- Depth (float): Depth priority (passed to batched line drawing).
- Higher values often render “on top” depending on engine/render settings.
- Segment / Segments / CircleSegments: Approximation detail.
- Higher = smoother curves, more draw cost.
3) Node reference
3.1 DrawPoint
Draws a single point in world space.
Parameters
- WorldLocation: point position
- Color
- Size (default 2)
- Depth (default 1)
Use cases
- Hit points, sample points, path markers
3.2 DrawLine
Draws a single world-space line segment.
Parameters
- StartLocation / EndLocation
- Color
- Thickness (default 2)
- Depth (default 1)
3.3 DrawLines
Draws a polyline by connecting adjacent points: Points[i] -> Points[i+1].
Parameters
- Points: array of world-space points
- PointsColor: per-point color array (must match Points length)
- Thickness / Depth
Important
- If
Points.Num() != PointsColor.Num(), the function returns immediately. - This does not auto-close. Use
DrawPolygonto close.
3.4 DrawCircle
Draws a circle approximation in the XY plane (constant Z).
Parameters
- WorldLocation: center
- Radius
- Segment: number of segments (default 6)
- Color / Thickness / Depth
Notes
- The implementation generates points using
(cos, sin, 0)and closes the loop.
3.5 DrawSphere
Draws a “wire sphere” using multiple circle rings along Z plus a central ring.
Parameters
- WorldLocation: center
- Radius
- Segment: affects ring resolution and ring count (clamped)
- Color / Thickness / Depth
Notes
- Ring count is
Clamp(Segment, 4, 64).
3.6 DrawBox
Draws an oriented box (OBB) wireframe.
Parameters
- WorldLocation: box center
- WorldRotation: box orientation
- BoxExtent: half-size along X/Y/Z
- Color / Thickness / Depth
3.7 DrawPrisms
Draws a pyramid/cone-like prism: base polygon + lines from base vertices to the apex.
Parameters
- WorldLocation: base center
- WorldRotation
- Radius: base radius
- Height: apex height along local +Z
- NumPrisms: number of base sides (>=3 recommended)
- Color / Thickness / Depth
Notes
- Also calls
DrawPolygonto draw the base outline.
3.8 DrawPolygon
Draws a polygon outline and auto-closes it.
Parameters
- Points: polygon vertices (world-space, ordered)
- Color / Thickness / Depth
Notes
- If
Points.Num() < 1, it returns. - Internally appends
Points[0]to close the loop.
3.9 DrawPizza
Draws “pizza slices”: several radial lines from the center and connects outer points.
Parameters
- WorldLocation: center
- Radius
- Pieces: slice count (implementation uses
Pieces - 1radial lines) - PerPieceDegrees: slice angle step in degrees
- Color / Thickness / Depth
Important (implementation detail)
- The outer arc connection is drawn with
DrawLines(Points)without closing back to the first point. - If you need a full outer circle, also call
DrawCircle.
3.10 DrawSpline
Draws a spline as a polyline by sampling points along the spline.
Parameters
- Spline:
USplineComponent* - Color
- Segment: sample segment count (declared as float; treat it like an integer >= 2)
- Thickness / Depth
Notes
- Step is computed as:
SplinePointCount / Segment.
3.11 DrawArrow
Draws an arrow: main shaft + four “wings” around the tip (Right/Up pairs).
Parameters
- StartLocation / EndLocation
- Color
- HeadLength: arrowhead wing length (clamped to arrow length)
- HeadAngleDegrees: wing angle in degrees
- Thickness / Depth
Notes
- If start/end are nearly identical, only the main line may be skipped/limited.
3.12 DrawFOVSector
Draws a 2D FOV sector in the XY plane based on WorldRotation forward direction.
Parameters
- WorldLocation: center
- WorldRotation: orientation (Forward is the sector’s center direction)
- Radius
- AngleDegrees: total angle
- Segments: arc subdivisions (min 2)
- Color / Thickness / Depth
- bDrawRays: draw the two boundary rays
- bDrawArc: draw the arc
- bDrawCenterLine: draw the center direction line
3.13 DrawFOVBoxFrustum3D
Draws a 3D camera-like frustum wireframe using near/far distances and FOV.
Parameters
- WorldLocation: origin (camera position)
- WorldRotation: frustum orientation
- NearDist / FarDist
- HorizontalFovDegrees / VerticalFovDegrees
- Color / Thickness / Depth
Notes
- Values are clamped:
NearDist >= 0FarDist >= NearDist + 0.01- FOV in
[0.01, 179]
- Draws 12 edges (near rect, far rect, and connectors).
3.14 DrawLatLongSphere
Draws a sphere grid made of latitude and longitude circles.
Parameters
- WorldLocation / WorldRotation
- Radius
- LatitudeLines (0..64)
- LongitudeLines (3..64)
- CircleSegments (8..256)
- Color / Thickness / Depth
3.15 DrawHelix
Draws a 3D helix (spring-like) as a polyline.
Parameters
- WorldLocation / WorldRotation
- Radius
- Pitch: vertical rise per turn
- Turns (>=1)
- SegmentsPerTurn (4..512)
- Color / Thickness / Depth
3.16 DrawElectricArc
Draws a lightning/electric arc: a jittered polyline, optionally layered.
Parameters
- StartLocation / EndLocation
- Color
- Segments (2..512)
- JitterAmplitude: jitter magnitude
- Seed: random seed for reproducibility
- Thickness / Depth
- Layers (1..8)
- LayerAmplitudeMultiplier: amplitude decay per layer (e.g., 0.6)
Notes
- Endpoints are stable; jitter is applied to interior points with a
sin(t*pi)falloff (max in the middle).
4) Where to call these nodes (Blueprint best practice)
- One-shot debug draw:
BeginPlayor a custom event. - Continuous debug draw:
Tick(useful for live visualization).- Keep segment counts reasonable; frequent drawing can be costly.
5) Common issues / troubleshooting
Nothing shows
- Ensure you call from a valid World context (Actors typically are fine).
- Increase
Thickness, ensureColor.A(alpha) is not 0. - Try adjusting
Depthif occluded.
DrawLinesdoes nothingPoints.Num()must equalPointsColor.Num().
Circles/spheres look jagged
- Increase
Segment/CircleSegments.
- Increase
6) Quick node list (for search)
- DrawPoint
- DrawLine
- DrawLines
- DrawCircle
- DrawSphere
- DrawBox
- DrawPrisms
- DrawPolygon
- DrawPizza
- DrawSpline
- DrawArrow
- DrawFOVSector
- DrawFOVBoxFrustum3D
- DrawLatLongSphere
- DrawHelix
- DrawElectricArc
