How to use AActor::DisplayDebug

I’ve created a custom c++ AActor and stumbled upon the DisplayDebug function. I guess it is for displaying debugging info which is useful. But how do you enable the display in game? Via the command line? Or is there a setting in the interface?

Description say it all:

“Draw important Actor variables on canvas. HUD will call DisplayDebug() on the current ViewTarget when the ShowDebug exec is used”

Which means DisplayDebug() will be called on view target (actor that camera is set on, you can set view target via player controller), to draw extra HUD elements with debug information, when you execute ShowDebug command in console. So it works like DrawHUD in AHUD, you got UCanvas argument forwarded which let you draw the debug HUD.

AActor as many other classes has it’s own on DisplayDebug setup (so you can check it out now using ShowDebug command)

https://github.com/EpicGames/UnrealEngine/blob/c9f4efe690de8b3b72a11223865c623ca0ee7086/Engine/Source/Runtime/Engine/Private/Actor.cpp#L1797

By calling Super::DisplayDebug() you will extend that view, if you won’t call it you will fully replace it. You can see there you can set up also categories of data to display using DebugDisplay.IsDisplayOn(TEXT(“category”))