UKismetSystemLibrary::GetConsoleVariableStringValue
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Retrieves the current value of a string console variable by name. Returns an empty string if the variable does not exist.
Caveats & Gotchas
- • A missing cvar and a cvar whose value happens to be an empty string both return an empty FString — you cannot distinguish 'not found' from 'set to empty' with this function alone.
- • The variable must already be registered (via TAutoConsoleVariable or IConsoleManager) before this call; it does not create the variable if absent.
- • Console variable names are case-insensitive, but pass the exact registered name to avoid confusion when auditing calls later.
Signature
static FString GetConsoleVariableStringValue(const FString& VariableName); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| VariableName | const FString& | Name of the console variable to look up. | — |
Return Type
FString Example
Read a string cvar C++
FString Value = UKismetSystemLibrary::GetConsoleVariableStringValue(TEXT("r.ScreenPercentage")); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?