// example 1, works in constructorIConsoleManager::Get().RegisterConsoleCommand( TEXT("TFC.Debug.DisplayInGamePlayerCharacterWindow"), TEXT("Show data for player"), FConsoleCommandDelegate::CreateWeakLambda(this, [this]() { bDisplayDebugWindow = !bDisplayDebugWindow; }));// example 2 (Northstar)auto& ConsoleManager = IConsoleManager::Get();ConsoleManager.RegisterConsoleCommand( TEXT("CyGlass.ToggleOverlay"), TEXT("Toggle CyGlass overlay."), FConsoleCommandDelegate::CreateUObject(this, &UCyGlassExtensionSubsystem::ToggleCyGlassOverlay)));
About re-registration warning (console commands and vars)
you might get the following warning Console object named 'xxx' already exists but is being registered again, but we weren't expected it to be!
You can totally ignore it if it happens when you hot reload/live code. For more details read the comment above the UE_LOG line
Other
Automatically Break on BP Exceptions
Add this in DefaultEditorPerProjectUserSettings.ini
Show BP Script Callstack on Warnings
add this in DefaultEngine.ini
[Kismet]ScriptStackOnWarnings=true
Other
Miscs
Reset editor camera to before-PIE location & rotation
Disable bEnableViewportCameraToUpdateFromPIV in Editor settings
Control Asset Open Location
Edit AssetEditorOpenLocation in Editor Settings
Handle crashing for shipping builds
Enable Include Crash Reporter in the project settings
If you want to have a more detailed call stack, you need to include the debug symbols in your build, to do so enable Include Debug Files.
More info on how to use symbols to read mini dumps in shipping builds while not shipping the debug symbols directly to the user. Time code (good for testing in a small environment)
Custom crash reporter and receive crash logs
If you want to make the user send the crash report to you (and not epic games (by default)), you can use a external tool that supports UE crash reporter (some example are Sentry, Bugsplat and Backtrace) Time code.