[UE5] Seeing the Invisible with Draw Debug and Visual Logger: Ranges, Facing, and Trails On Screen

Created: 2026-07-25Last updated: 2026-09-05

An introduction to drawing ranges and facing on screen in UE5. Try Draw Debug Sphere and Cone on a small Actor and learn what position, radius, angle, and Duration mean, plus how to revisit recorded moments with the Visual Logger.

You set the enemy's detection distance to 800 , but it does not react to the player right in front of it. Even with the number entered correctly, how far that range reaches on screen is hard to picture.

In that case, draw a sphere of radius 800 around the enemy. If the player is outside it, you can investigate distance first. If they are inside it, move on to the next conditions such as facing and wall occlusion.

This article tries the Draw Debug nodes that draw check lines and spheres. Read values with Print String and see spatial relationships with Draw Debug. Combining the two makes internal game behavior easier to follow.

Drawing a range around the guard reveals it does not reach the other party

What You'll Learn

  • Displaying position, radius, and facing as spheres and cones
  • The relationship between Duration and when you call the drawing
  • Choosing between the editor's built-in display and drawing your own
  • Reading back recorded moments with the Visual Logger

Sponsored

Tie numbers to sizes in the game world

UE's standard length unit is cm. A radius of 800 is 8 m and measures from the center to the sphere's surface . End to end, the diameter is 16 m.

Comparing the number "radius 800" with the range as actually drawn

What is unclear is less the number itself and more "from where", "in which direction", and "how far" you measure. An attack volume's center might be at the feet rather than the hand, or a guard's forward might differ from the model's face.

Passing the position and distance actually used in the check into the drawing is what finds these mismatches. Entering different numbers for display makes only the diagram look correct, so watch for that.

Choosing among Draw Debug nodes

Searching Draw Debug in a Blueprint's Event Graph offers nodes per shape.

Shapes drawn by Sphere, Line, Box, Arrow, Cone, and String and where each fits
NodeWhat it drawsWhere it fits
Draw Debug SphereA sphere's outlineEnemy detection distance, explosion radius
Draw Debug LineA line from start to endThe relation between an enemy and its target
Draw Debug BoxA box's outlineRoom and trigger volumes
Draw Debug ArrowAn arrowMovement or knockback direction
Draw Debug ConeA cone's outlineA guide for a forward field of view
Draw Debug StringText at a specified 3D positionThe current state next to an enemy

Position, size, color, and display time are enough to start. A Box's "Extent" is half the size from the center to each face, not the box's full width. A Cone draws a cone spreading vertically too, not a flat fan.

Draw Debug String specifies where the text appears in "Text Location". Adding (0, 0, 120) to an Actor's position, for instance, puts it 120 cm above. When passing world coordinates like that, leave "Test Base Actor" unspecified. Specifying a target makes the position relative to that Actor, so do not mix the two.

Line Trace has its own display setting. A Line Trace extends a line from a start to an end point and checks what it hits. Setting Line Trace by Channel 's "Draw Debug Type" to "For Duration" displays the traced line and hit position. To investigate the trace itself, that setting is easier (see the Line Trace article).

Duration is how many seconds lines persist

Duration sets how many seconds a drawn shape remains. We deal with nodes that draw shapes as lines, such as Sphere and Cone. 0 means "one frame only". A frame is one update of the game's screen.

Persisting for 10 seconds from BeginPlay versus redrawing at the current position every Tick
Where you call itDurationHow it looks
Event BeginPlay: once at start10.0Stays where drawn for 10 seconds
Event BeginPlay: once at start0.0Disappears after one frame
Event Tick: every frame0.0Redrawn each time, so it follows a moving target

A sphere drawn in BeginPlay does not follow the Actor afterwards. To match a moving enemy, pass its position at that moment every Tick. Conversely, a long Duration on Tick leaves old lines overlapping like a trail.

The standard Blueprint Draw Debug Sphere has no "Persistent Lines" setting. To study a static shape at leisure, lengthen Duration first. Not confusing it with settings from C++-oriented articles matters.

Try the editor's display first

For existing collision volumes and light ranges, you can often check without building drawing nodes.

What you want to seeHow
Collision shapes"Show → Collision" in the viewport, or the console command show collision during Play
NavMesh: the walkable area AI uses to find pathsP in the level viewport. Displaying it requires a NavMesh to exist
The range of a Point Light and similarSelect the light Actor
Sphere / Box Collision shapesSelect that component in the Blueprint editor or level

Collision is the hit volume and a component is a part attached to an Actor. Selecting a Sphere Collision and changing its radius already lets you judge the size visually.

Draw Debug earns its place when following a range that moves during Play or when you want to see a position built from variables and calculations. Our exercise draws a sphere from a variable holding the radius.

Collision and NavMesh handled by the editor's display, with Draw Debug for moving ranges and computed positions
Sponsored

Hands-On: draw a radius-800 range and the forward facing

In a test level from the Third Person template, build a BP_Guard that displays a range. We build display only and add no AI spotting or chasing logic. Drawing a sphere and detecting who enters it are separate.

1. Place a check Actor

Actor is the base class for things placed in a level. Here we prepare an Actor with a box as a marker in place of a guard.

  1. Create "Blueprint Class → Actor" in the Content Browser and name it BP_Guard .
  2. Open it, add a "Static Mesh" via "Add", and choose Cube in the Static Mesh field. That marks the position.
  3. Create a Float SightRange under "My Blueprint → Variables". Float is the numeric type handling decimals.
  4. Compile, then set its default to 800.0 and save.
  5. Place one in the level on a wide walkable floor. Set the Actor's Scale to (1, 1, 1) and Rotation to (0, 0, 0) . Adjust the position so the box does not sink into the floor and save the level.

SightRange is a variable name we chose to represent range. UE does not read that name and enable AI sight automatically.

2. Draw the sphere

In BP_Guard's Event Graph, add Draw Debug Sphere from Event Tick 's white exec pin. Configure its inputs as follows.

Calling Sphere from Tick, passing the Actor's location into Center and SightRange into Radius

"To the next Cone" in the diagram notes where we connect in a later step. You can test with just the Sphere for now.

InputValue / setting
CenterGet Actor Location 's Return Value with Target Self
RadiusA Get of the variable SightRange
Segments16
Line ColorBlue
Duration0.0
Thickness2.0

Self is the BP_Guard running this graph. Get Actor Location reads that Actor's position and passes it from Return Value. That position is not necessarily the model's visual center but the Actor's origin.

Place a variable Get by dragging the variable into the graph and choosing "Get". Get Actor Location and variable Gets have no white exec pin, so connect their value outputs into the Sphere's corresponding inputs . The white exec line goes directly from Tick to Sphere.

Compile, Save, and Play, and a blue sphere appears centered on the box's position. Move the camera and walk inside and outside the sphere to compare. Even with the lower half hidden by the floor, the whole sphere's center is the box Actor's position.

Next stop Play, change SightRange's default to 1200.0 , and Play again. The sphere widening is success. You can compare the range going from 8 m to 12 m against the surrounding floor and walls.

3. Draw a cone forward

Stop Play and connect Draw Debug Cone from Draw Debug Sphere's white output. This time we use the Actor's facing as well as distance.

Calling Cone from Sphere, passing position, forward direction, and range into Origin, Direction, and Length
InputValue / setting
OriginGet Actor Location 's Return Value with Target Self
DirectionGet Actor Forward Vector 's Return Value with Target Self
LengthA Get of SightRange
Angle Width / Angle HeightEnter 45.0 for both
Num Sides16
Line ColorYellow
Duration / Thickness0.0 / 2.0

A Forward Vector is the direction representing an Actor's front. It is not a position, so do not connect Get Actor Location into Direction. In UE, an Actor's own X axis is its front, so with zero rotation the cone extends along world positive X.

The standard Blueprint node used here takes angles in degrees . Enter 45.0 directly. The angle is the spread from the center line to one side, so 45 degrees each way is 90 degrees total. The same-named function in C++'s DrawDebugHelpers uses different units, but this procedure needs no radian conversion.

Compile, Save, Play, and confirm the yellow cone. Stop Play, change the Actor's Z rotation to 90 degrees, and Play again to see the facing change. Then change only "Angle Width" from 45 to 60 to widen the horizontal spread. Changing one value at a time makes it easier to confirm what each setting affects.

What the shapes tell you and what they do not

Spheres and cones are markers drawing the values you passed . When adding to real AI, pass the same position, range, and facing as the detection logic and compare. Even with the shape reaching the target, it says nothing about wall occlusion, the target's settings, or a forgotten check call (see AI Perception).

ProblemWhere to check
Nothing is drawnWhether BP_Guard is placed, whether the white exec line connects, whether you are in Play
It appears for an instantWhether you call it from BeginPlay with Duration 0
Old spheres pile upWhether you call from Tick with a long Duration
It appears near the originWhether you pass a position into Center / Origin
The cone faces the wrong wayThe Actor's rotation and Forward Vector. Whether you rotated only the mesh
The cone is too narrowWhether the angle is passed in degrees, and whether an unnecessary radian conversion crept in

After checking, remove the test Actor or disconnect the drawing nodes. To build it into normal game logic, a Boolean variable toggling the display is convenient.

Revisit recorded moments with the Visual Logger

The trouble with Draw Debug is that the moment you want passes. "The enemy turned toward me for an instant — what was it heading for?" To keep that moment's information, use the Visual Logger .

Comparing Draw Debug, which shows the present shapes, with the Visual Logger, which reselects records along a timeline

The Visual Logger records positions, shapes, states, and more sent tied to an Actor, along with the time. It reads back recorded data rather than rewinding the whole game like video. Spheres drawn with Draw Debug are not recorded automatically.

  1. Open it from "Window → Developer Tools → Visual Logger". Some UE versions offer it directly under Window.
  2. Turn the record button on and Play.
  3. Reproduce the motion you want to investigate, then stop recording and end Play.
  4. Choose the target that sent records from the Actor list and pick a moment on the timeline. The timeline lays records out in time order.
  5. Compare the position, shapes, and text at that moment. Save the record to a file if needed.

Some of UE's AI features send information to the Visual Logger, but not every Actor's state is recorded automatically . Our BP_Guard only draws, so it does not record our own range or variables as is.

To record your own information, use the position and text logging nodes under "Debug → Visual Logger" in Blueprint. VisLog Location (or Log Location on some versions), for instance, records a position. Call it while recording is running and pass the position to investigate into Location. Get comfortable with on-the-spot checks in Draw Debug first and add this when you want to investigate a moment you missed.

Sponsored

Bonus: good to know up front

  • Do not use it for production range display : the debug drawing covered here is for development. It does not display in a normal Shipping build. For attack ranges shown to players, use Decals projecting patterns onto the ground or display meshes.
  • Narrow down who draws : many enemies drawing spheres every frame costs performance in the display itself. Start with one Actor under investigation.
  • Segments changes smoothness : it is how many segments divide the sphere's lines. Raising it smooths the shape, but readable outlines are enough for checking.
  • Give colors roles : blue for distance, yellow for facing, or whatever combination you can distinguish. To investigate logs and variables alongside shapes, combine with the Blueprint Debugger.

Summary

Draw Debug lets you draw the position, distance, and facing you pass into logic and confirm them in place. Start by drawing one sphere and comparing as you change the radius. Redraw on Tick for moving targets, and specify seconds from BeginPlay for static shapes.

Once ranges are visible, combine with logs to grow the set of things you can confirm as "correct so far". To investigate further back in time, recording the information you need to the Visual Logger helps.

Further Reading

Unreal Engine Notes in this section98