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

Auto Settings 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

Create the Blueprint class

  1. Right-click in the Content Browser and select Blueprint Class.
  2. Search for the parent class ConsoleVariable.
  3. Choose the appropriate type from the table above.

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.

Implement the OnChanged event

  1. Switch to the Event Graph.
  2. Right-click and add Event On Changed.
  3. Implement the logic that should run 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 Binding 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.