Goal: Create custom console commands (~) to toggle specific debugging features at runtime without recompiling.
- Declare a static variable outside your class:
static TAutoConsoleVariable<int32> CVarMyDebug(TEXT("MyGame.DebugMode"), 0, TEXT("Toggles my custom debug view.")); - In your
TickorUpdatefunction, check the value:if (CVarMyDebug.GetValueOnGameThread() > 0) { // Do debug stuff }.
EN
TR