#unreal

Enabling console in packaged builds

You can enable console and most of its commands in packaged builds.

UGameViewportClient* Viewport = WorldContextObject->GetWorld()->GetGameViewport();
if(Viewport->ViewportConsole == nullptr)
{
	Viewport->ViewportConsole = NewObject<UConsole>(Viewport, GEngine->ConsoleClass);
}
 

Custom console commands

Using UFUNCTION(Exec) makes a function executable from the console. CheatManager is a good place to store general purpose console commands.