Engine & Editor cmds/vars

Object console commands list here You can have a cool panel with your console commands & vars in Window->Console Variables

Saving console variables

You can either use the console command window, set the console variable value in the correct .init in the correct section, or see ConsoleVariables.ini (special file that doesn’t exist by default, can be copied from source engine).

List of console cmds/vars

Miscs

  • ShowDebug [Name], by default this will give details about the player pawn/character
  • ToggleDisplay : disables all HUD
  • show COLLISION : displays collisions, works in PIE
  • slomo <new time dilation>: changes the world time dilation

Rendering

  • FreezeRendering, good to use with ToggleDebugCamera, allows you to see how culling works, with extra stuff like seeing the POV of different steps of rendering (press B)
  • ToggleDebugCamera
  • ProfileGPU panel, also named “GPU Visualizer”
  • r.Streaming.PoolSize XXX
  • r.VisualizeOccludedPrimitives and r.AllowOcclusionQueries

Physics

Making your own console cmds/vars

  • Details about Exec functions
  • For static variables (int32, float, bool, FString) see FAutoConsoleVariableRef
  • For commands see FAutoConsoleObject and the childs such as FAutoConsoleCommandWithWorld or FAutoConsoleCommand
  • To save the cvars values, see UDeveloperSettingsBackedByCvars.

Code snippets

static float DrawingShowFlagsMaxDrawDistance = 3500;  
static FAutoConsoleVariableRef CVarDrawingShowFlagsMaxDrawDistance(  
    TEXT("BrutalPuzzle.Editor.DrawingShowFlagsMaxDrawDistance"),
    DrawingShowFlagsMaxDrawDistance,  
    TEXT("Limits the drawing of custom show flags to this distance"),  
    ECVF_Default  
);
#if !NO_CVARS && TFC_WITH_CONSOLE  
    /**  
     *     
     *  @return "TFC.Debug.TheName"     
     *  @return "TFC.Debug.OptionalSubCatepgry.TheName"
     */
#define TFC_Console_Internal_BuildFullCommandString(SubNameString, SubCategoryString) \  
    FString::Printf(TEXT("TFC.Debug.%s"), *(SubCategoryString.IsEmpty() ? SubNameString : SubCategoryString + "." + SubNameString))  
  
    struct FTFCAutoConsoleCommandWithWorld : private FAutoConsoleCommandWithWorld  
    {  
       FTFCAutoConsoleCommandWithWorld(const FString& SubName, const FString& Help, const FConsoleCommandWithWorldDelegate& Delegate, const FString& OptionalSubCategory = "")  
          : FAutoConsoleCommandWithWorld(*TFC_Console_Internal_BuildFullCommandString(SubName, OptionalSubCategory), *Help, Delegate, ECVF_Default)  
       {}  
    };
//...

Run commands from code

Blueprint

Use the Execute Console Command node, the player parameter is not required in all cases.

C++

We can use the same logic than the BP node (UKismetSystemLibrary::ExecuteConsoleCommand). Internally it uses ConsoleCommand on the Player Controller if valid and Exec on the GEngine if not. It seems safer to use the kismet function because it has some extra safety measures.