UKismetSystemLibrary::GetConsoleVariableFloatValue
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Retrieves the current value of a float console variable by name. Returns 0 if the variable does not exist.
Caveats & Gotchas
- • A missing cvar and one legitimately set to 0.0 return the same value, so this cannot tell you whether the variable exists.
- • Passing the name of an int or bool cvar instead of a float cvar returns 0 rather than converting the value, since the lookup is type-specific.
Signature
static float GetConsoleVariableFloatValue(const FString& VariableName); Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| VariableName | const FString& | Name of the console variable to look up. | — |
Return Type
float Example
Read a float cvar C++
float ScreenPct = UKismetSystemLibrary::GetConsoleVariableFloatValue(TEXT("r.ScreenPercentage")); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?