How can I create/customize my own console commands in C++?

If you inherit the cheat manager and built any functions in it, they will be recognized.

But you need to swap out the default cheat manager within APlayerController with the code below, in constructor, or its blueprint equivalent. (Go to details panel and type cheat manager)

AMyPlayerController::AMyPlayerController
{
    CheatClass = UMyCheatManager::StaticClass();
}

As for compilation, anythings tight to UFUNCTION() or UPROPERTY() will need to regenerate its generated.h, recompile it instead of hot reload for a better “life experience”.

The engine has too much code, I had no idea which one going to run first. I only sure about the inherited one because it is easier to place breakpoints. Engine breakpoints might not hit due to optimization.

2 Likes