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
IConsoleVariablesystem
For C++ projects, use Unreal's native console variable system directly instead of Blueprint console variables.
Console Variable types
| Type | Blueprint Class | Use Cases | Examples |
|---|---|---|---|
| Boolean | ConsoleVariable Boolean | Feature toggles, on/off settings | game.ShowSubtitles, r.VSync |
| Integer | ConsoleVariable Integer | Discrete levels, enumerated values | sg.OverallScalability, game.DifficultyLevel |
| Float | ConsoleVariable Float | Continuous ranges, percentages | game.MasterVolume, game.MouseSensitivity |
| String | ConsoleVariable String | Text values, language settings | game.Language, ui.Theme |
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
- Right-click in the Content Browser and select Blueprint Class.
- Search for the parent class
ConsoleVariable. - 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)"
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
- Switch to the Event Graph.
- Right-click and add Event On Changed.
- Implement the logic that should run when the value changes.
Example:
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.