---
title: AFU_Debug
product: Advanced Framework Pro
version: 1.0
engine: Unreal Engine 5.8
updated: 2026-10-05
canonical: https://docs.human-codeable.com/plugins/afu-debug.html
---

Utility

# AFU_Debug

Runtime debug overlay showing FPS, frame time, draw calls, triangles, object and widget counts, backed by a C++ stats library.

#### What it gives you

- Live performance readout in VR and on desktop
- Scene and object statistics
- A debug page for the menu

#### Requires

None

#### Required by

None

8 assets20 API members

## Description

Performance problems in VR are hard to diagnose from outside the headset. `AFU_Debug` puts the numbers in front of the player: frame rate, frame time, draw calls, triangle count, primitive and component counts, total UObjects, and total and visible widget counts.

`UAFUDebugStatsLibrary` provides the values in C++; the widgets present them through the info panel system, and `DA_WidgetPage_Debug` drops the whole thing into the menu as a page.

## Setup

1. Enable `AFU_Debug`.
2. Add `DA_WidgetPage_Debug` to your pawn's `BPC_Pawn_Menu` **Pages** list.

## Usage

### Reading the overlay

Widget count is the one most often overlooked — a high visible widget count is a common cause of poor VR frame times.

### Using the stats in your own UI

Call the `UAFUDebugStatsLibrary` functions directly; they are Blueprint-pure and available anywhere.

[![The debug overlay in play](../images/AFU_Debug_result-1600.webp?v=42ed0e5f)](../images/AFU_Debug_result-1600.webp?v=42ed0e5f)

The debug overlay in play

## Key properties

| Property | When to change |
|---|---|
| Which panels are shown | Add or remove the info panel widgets from the debug page |

## Extending

Add your own info panel widgets deriving from `WBP_Base` and register them alongside the shipped ones.

## Performance notes

Performance

The overlay itself costs draw calls and widget updates. Remove the debug page from shipping builds rather than only hiding it.

## Example map

Available as a menu page in `Map_Examples_Lobby`.

## Troubleshooting

**Stats read zero.** The stats library needs a world context; ensure the calling widget has a valid owning player.

## API reference

Every blueprint asset in this plugin. Expand an asset to see its members.

### Libraries

**BFL_Debug**1 members

extends `BlueprintFunctionLibrary`

Function library holding one static call, Get Platform Type, which folds the running platform and whether a headset is enabled into a single name: PC, PC VR, Mobile, Mobile VR, Console or Console VR. Call it when behaviour should branch by device rather than by pawn.

| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | `getPlatformType` | `(__WorldContext: Object, out PlatformType: name)` | Returns the platform the build is running on as one of PC, PC_VR, Mobile, Mobile_VR, Console or Console_VR. Windows, Mac and Linux fold into PC, Android and iOS into Mobile, and PlayStation, Xbox and Switch into Console, with the VR variant chosen whenever a head mounted display is enabled. An unrecognised platform comes back as None. |

### Widgets

**WBP_Debug**0 members

extends `WBP_Base`

Root widget of the debug menu, pairing a horizontal pagination bar with a switcher over the scene and level pages. Show it through the pawn UI or HUD when you want the debug tools in a build; nothing in the framework opens it for you.

No editor-visible members; this asset configures defaults only.

**WBP_Debug_Levels**3 members

extends `WBP_Base`

Level page of the debug menu. Walks every actor in the world to collect the streaming levels in play, lists them as checkbox buttons and loads or unloads a level when its button is clicked, flushing streaming so the change is immediate. Part of the debug menu rather than a widget to use alone.

| Kind | Name | Signature | Description |
|---|---|---|---|
| fn | `UpdateLoadedLevels` | `()` | Refreshes the level list so a checkbox is ticked for each streaming level that is currently visible. Runs at the end of Get All Levels and after every toggle, and is worth calling again whenever levels are streamed in or out behind the menu's back. |
| fn | `GetAllLevels` | `()` | Walks every actor in the world, collects the name of each streaming level they live in, and adds one checkbox to the level list per name before refreshing which of them are ticked. Call it once as the page opens; calling it again appends a second checkbox for every level already listed. |
| event | `WidgetElement_PostInitiate`Style | `()` | Called on every element once the entire tree has been initiated and themed. Implement it for set-up that needs the finished tree, such as measuring or reading the state of a sibling. |

**WBP_Debug_Scene**4 members

extends `WBP_Base`

Scene page of the debug menu. Holds the view mode drop-down, which runs the matching viewmode console command, and the toggles for the frame rate, object and scene info panels and for skeletal mesh and particle rendering. Part of the debug menu rather than a widget to use alone.

| Kind | Name | Signature | Description |
|---|---|---|---|
| event | `WidgetElement_PostInitiate`Style | `()` | Called on every element once the entire tree has been initiated and themed. Implement it for set-up that needs the finished tree, such as measuring or reading the state of a sibling. |
| event | `UpdateFPSState` | `()` | Sets the Show FPS toggle to match whether the frame rate info panel is currently on the player pawn's display. Call it whenever that panel is opened or closed from somewhere other than this page. |
| event | `UpdateObjects` | `()` | Sets the Object Counter toggle to match whether the object count info panel is currently on the player pawn's display. Nothing on this page calls it, so call it yourself after that panel is opened or closed. |
| event | `UpdateScene` | `()` | Sets the Scene Counter toggle to match whether the scene statistics info panel is currently on the player pawn's display. Nothing on this page calls it, so call it yourself after that panel is opened or closed. |

### Widgets/Helper

**WBP_Stat_Row**6 members

extends `WBP_Base`

One row of a debug info panel: a title, a caption carrying the maximum, and a value that shifts from green to red as it approaches that maximum, or the other way round when inverted. Reused by the frame rate, object and scene panels; the format text decides the unit shown after the number.

| Kind | Name | Signature | Description |
|---|---|---|---|
| var | `Main Text`Description | `text` | Label naming what the row measures, such as FPS, Objects or Draw Calls. Set it on the row instance in the designer; nothing in the graph rewrites it while the game runs. |
| var | `Max Value`State | `int` | Figure treated as the top of the range when the readout is coloured, and the number shown in the caption under the label. Set Max Value writes both at once; left at zero the colour ramp has no range to work against and the readout sits at one end of it. |
| var | `Format`Description | `text` | Text the current figure is substituted into before it is shown, {Value} by default. Put {Value} where the number belongs and add the unit around it, as in {Value}ms or {Value}/s. |
| var | `Percentage`Description | `float` | Fraction of Max Value over which the readout changes colour, 0.2 by default. At 0.2 the figure stays green until it passes eighty per cent of Max Value and is fully red by the time it reaches it; raise it to start the shift earlier. |
| event | `UpdateValue` | `(CurrentValue: int)` | Writes a new figure into the row through the Format text and recolours it by how close it sits to Max Value, running from green up to red across the top slice of the range set by Percentage. Invert swaps the two ends for figures where high is good. |
| event | `SetMaxValue` | `(MaxValue: int)` | Stores a new ceiling for the row and writes it into the caption under the label. Call it before the first Update Value, since a row left at zero has no range to colour against. |

### Widgets/InfoPanels

**WBP_InfoPanel_FPS**2 members

extends `WBP_Base`

Debug overlay showing frames per second and frame time in milliseconds, both coloured against their limits. Refreshed by calling Update FPS, and toggled from the scene page of the debug menu rather than opened directly.

| Kind | Name | Signature | Description |
|---|---|---|---|
| event | `UpdateFPS` | `()` | Pushes the current frame rate and frame time in milliseconds, both rounded to whole numbers, into the two rows of the panel. Nothing drives it on its own, so call it from a timer or a tick if the readout should keep moving. |
| event | `WidgetElement_PostInitiate`Style | `()` | Called on every element once the entire tree has been initiated and themed. Implement it for set-up that needs the finished tree, such as measuring or reading the state of a sibling. |

**WBP_InfoPanel_Objects**2 members

extends `WBP_Base`

Debug overlay counting the live objects, components and widgets in the running game, useful for tracking down leaks and pooling that never returns anything. Refreshed by calling Update Count, and toggled from the scene page of the debug menu.

| Kind | Name | Signature | Description |
|---|---|---|---|
| event | `UpdateCount` | `()` | Pushes the total object count, component count and widget count of the running game into the three rows of the panel. Nothing drives it on its own, so call it from a timer or a tick to keep the counts current. |
| event | `WidgetElement_PostInitiate`Style | `()` | Called on every element once the entire tree has been initiated and themed. Implement it for set-up that needs the finished tree, such as measuring or reading the state of a sibling. |

**WBP_InfoPanel_Scene**2 members

extends `WBP_Base`

Debug overlay showing the triangle count and draw calls of the current frame, the two numbers that matter most on standalone headsets. Refreshed by calling Update Count, and toggled from the scene page of the debug menu.

| Kind | Name | Signature | Description |
|---|---|---|---|
| event | `UpdateCount` | `()` | Pushes the triangle count and the number of draw calls of the last frame into the two rows of the panel. Nothing drives it on its own, so call it from a timer or a tick to keep the readout current. |
| event | `WidgetElement_PostInitiate`Style | `()` | Called on every element once the entire tree has been initiated and themed. Implement it for set-up that needs the finished tree, such as measuring or reading the state of a sibling. |
