Skip to main content
Version: 2.x

Console Variables

Create console variables in Blueprint to define custom game settings that integrate with Unreal Engine's console system.

Overview

AutoSettings extends Unreal Engine's console variable system with Blueprint support. Console Variables work with the core setting framework using Blueprint classes:

  • Console Variable Blueprints - Blueprint classes that define console variables (Boolean, Integer, Float, String)
  • Automatic Registration - Console variables are auto-discovered at startup, no manual registration code required
  • OnChanged Event - Implement to respond when values change from console, config, or settings UI
  • Engine Integration - Built on Unreal's native IConsoleVariable system
C++ Projects

For C++ projects, use Unreal's native console variable system directly instead of Blueprint console variables.

Console Variable Types

TypeBlueprint ClassUse CasesExamples
BooleanConsoleVariable BooleanFeature toggles, on/off settingsgame.ShowSubtitles, r.VSync
IntegerConsoleVariable IntegerDiscrete levels, enumerated valuessg.OverallScalability, game.DifficultyLevel
FloatConsoleVariable FloatContinuous ranges, percentagesgame.MasterVolume, game.MouseSensitivity
StringConsoleVariable StringText values, language settingsgame.Language, ui.Theme
Validate Values

For Integer and Float types, use the Clamp node in OnChanged events to validate ranges and prevent invalid values.

Creating a Console Variable

Step 1: Create the Blueprint Class

  1. Right-click in Content BrowserBlueprint Class
  2. Search for parent class: Type ConsoleVariable
  3. Choose the appropriate type from the table above

Step 2: Configure Class Defaults

Open your Blueprint and set the Class Defaults:

  • Name: The console variable name (e.g., "game.MasterVolume")
  • Default Value: Starting value when no config exists
  • Help Text: Description shown in console help

Example:

Name: "game.MasterVolume"
Default Value: 1.0
Help Text: "Master volume multiplier (0.0 to 1.0)"
Naming Convention

Use a prefix to group related settings (e.g., game.* for gameplay, audio.* for audio, ui.* for interface). Avoid spaces and special characters.

Step 3: Implement OnChanged Event

  1. Switch to Event Graph
  2. Add Event: Right-click → Add EventEvent On Changed
  3. Implement your logic: What should happen when the value changes

Example:

Example Project

The example project uses a more complete implementation with Push Sound Mix Modifier and Set Sound Mix Class Override for proper audio mixing.

Your console variable is automatically registered and can be tested in the console or used in settings menus via the Console Variable Application Strategy.

Testing Console Variables

Press ~ (tilde) to open the console and test your console variable:

game.MasterVolume              // Show current value
game.MasterVolume 0.5 // Set new value
game.MasterVolume ? // Show help text

Add logging to OnChanged events for debugging:

See the example project for a complete implementation.