Daily Unreal Column #48 - Debug Drawing
Visualizing your data is sometimes the easiest way to understand what is going on inside your system. Here is a set of helper functions that make adding debug drawing trivial.
Unreal Engine has a lot of helper debug drawing functions inside DrawDebugHelpers.h
file. Some of the most common ones are:
DrawDebugLine
DrawDebugPoint
DrawDebugBox
DrawDebugSphere
many, many more
Here is an example usage:
DrawDebugLine(
GetWorld(),
GetActorLocation(),
GetActorLocation() + GetActorForwardVector() * 100.0,
FColor::Green);
This will result in a green line drawn from the center of the actor showing its forward vector.
Here is an example how DrawDebugLine
and DrawDebugCircleArc
look like in game view: