Visual Debugger Documentation

User manual for version 1.0.0. Also included in the package as Documentation.pdf. Back to the product page.

Contents

  1. What Visual Debugger does
  2. Installation
  3. Your first debug message
  4. On-screen messages
  5. World-space shapes
  6. Choosing where debug output appears
  7. Trying it without writing code
  8. Updating the package
  9. Troubleshooting
  10. Support

1. What Visual Debugger does

Visual Debugger puts your debug output where you are already looking: on the screen and in the game world. It has two systems, and both are used the same way, with one line of code:

  • On-screen messages. DebugScreen.Log prints a colored message to a list in the corner of the screen. The message disappears on its own after the number of seconds you choose.
  • World-space shapes. DebugDraw draws spheres, cubes, arrows, and text labels at any position in the world, in any color, for however long you choose. Shapes draw on top of everything, so walls never hide them.

There is nothing to set up in your scene. The first call creates everything the systems need, and they keep working when a new scene loads.

1.1 Requirements

Unity 6000.3 or newer. No other packages are required.

1.2 What is in the package

The package installs into Assets/Zest Studios/VisualDebugger. It contains the compiled tool (Runtime and Editor), a demo scene in the Demo folder, and the manual.

1.3 Coming from Unreal?

Every Unreal debug helper you are used to has a direct equivalent:

UnrealVisual Debugger
GEngine->AddOnScreenDebugMessageDebugScreen.Log
DrawDebugSphere / DrawDebugBoxDebugDraw.Sphere / DebugDraw.Cube
DrawDebugStringDebugDraw.Text
DrawDebugDirectionalArrowDebugDraw.Arrow

2. Installation

  1. Import the package from the Asset Store (Window > Package Manager > My Assets).
  2. Wait for Unity to finish importing and compiling. That is the whole installation; there is no setup window and nothing to configure.
Where did it go? The package lives in Assets/Zest Studios/VisualDebugger, and its menu is Tools > Visual Debugger.

3. Your first debug message

  1. Open any script that runs in your scene (or create a new MonoBehaviour and add it to any GameObject).
  2. Add the using line at the top of the file, and a log call in Start:
using Zest.VisualDebugger;

void Start()
{
    DebugScreen.Log("Hello from Visual Debugger!", 3f, Color.green);
    DebugDraw.Sphere(transform.position, 3f, 1f, Color.red);
}
  1. Press Play. A green message appears on the screen, and a red wireframe sphere appears at the object's position. Both disappear after three seconds.

4. On-screen messages

One method does everything:

DebugScreen.Log(
  string label,   // the text to show
  float time,   // how many seconds it stays on screen
  Color color);   // the text color

Messages stack in a list on the screen with the newest at the top, and each message fades out when its time runs out.

// A one-off event
DebugScreen.Log("Checkpoint reached", 2f, Color.yellow);

// A live stat: log it every frame with a short time
DebugScreen.Log($"Speed: {speed:0.0}", 0.1f, Color.cyan);

5. World-space shapes

All shapes share one parameter order: position, (direction or rotation,) duration, size, color. Note that duration comes before size.

DebugDraw.Sphere(Vector3 position, float duration = 5f, float size = 1f, Color color = default);
DebugDraw.Cube  (Vector3 position, float duration = 5f, float size = 1f, Color color = default);
DebugDraw.Cube  (Vector3 position, Vector3 rotation, float duration = 5f, float size = 1f, Color color = default);
DebugDraw.Text  (Vector3 position, string label, float duration = 5f, float size = 1f, Color color = default);
DebugDraw.Arrow (Vector3 position, Vector3 direction, float duration = 5f, float size = 1f, Color color = default);

Details worth knowing:

  • The second Cube overload takes Euler angles for oriented boxes.
  • Arrow takes a direction vector; the arrow points along it, and size is its length.
  • Shapes draw with an always-on-top material, so they stay visible through geometry.
  • Shapes are pooled. Calling draw methods every frame is fine.
Color is optional. If you leave the color out, the shape is drawn in white. Pass a color when you need to tell shapes apart.
// An aim line from the muzzle, 1.5 units long, for 2 seconds
DebugDraw.Arrow(muzzle.position, muzzle.forward, 2f, 1.5f, Color.yellow);

// A label above an enemy for 1 second
DebugDraw.Text(enemy.position + Vector3.up, "HP 3/3", 1f, 1f, Color.white);

6. Choosing where debug output appears

You control where debug output shows up, without touching your code. Open Tools > Visual Debugger > Debug Settings. Shape debugging and screen debugging each have their own mode:

ModeBehaviour
OffCalls are ignored everywhere.
Editor Only (default)Draws in the editor, ignored in every build.
Editor + Development BuildsAlso draws in builds made with Development Build enabled. Use this for on-device debugging.
All BuildsDraws everywhere, including release builds.

The setting is stored in Resources/VisualDebuggingSettings.asset inside the package, so your builds read the same value as the editor. When a system is off, calls return immediately and no debug objects are ever created, so leftover calls cost almost nothing.

7. Trying it without writing code

Two helper components let you fire test output from the Inspector:

  1. Add the DebugScreenTester or DebugWorldTester component to any GameObject.
  2. Press Play.
  3. Use the buttons in the component's Inspector to fire random test messages and shapes.

The Demo folder also contains a small sample scene showing both systems in a playable setting.

8. Updating the package

An update replaces the package folder (Assets/Zest Studios/VisualDebugger). Your own scripts are never touched by an update.

One thing to re-check: the Debug Settings asset lives inside the package folder, so an update resets it to the default (Editor Only for both systems). If you had changed the modes, open Tools > Visual Debugger > Debug Settings after updating and set them again.

9. Troubleshooting

ProblemFix
Nothing draws in my buildThe default mode is Editor Only. Open Tools > Visual Debugger > Debug Settings and choose Editor + Development Builds (and make sure Development Build is ticked in Build Settings), or All Builds.
A shape is invisibleIf you passed a color, check its alpha: an alpha of 0 draws fully transparent. An omitted color draws white. Also remember the parameter order: duration comes before size.
My message vanishes instantlyThe second parameter of DebugScreen.Log is the time in seconds. A very small value (for example 0.1f) is right for per-frame stats, but a one-off message needs a second or more.
A shape lasts longer or is bigger than expectedThe parameter order is duration first, then size. Sphere(pos, 5f, 1f) is five seconds at size one, not the other way round.
Output still shows in a release buildOne of the modes is set to All Builds. Open Tools > Visual Debugger > Debug Settings and lower both modes.

10. Support

Discord: discord.gg/2ths8Hj9QE (the fastest way to reach us)

Email: studioszest@gmail.com

If anything in this manual is unclear, that is a bug in the manual. Tell us and we will fix it.

← Back to Visual Debugger