Is there a way to set the console variable t.MaxFPS in C++?
I have tried GEngine->GetWorld()->Exec(GEngine->GetWorld(), TEXT(“t.MaxFPS 60”)), it doesn’t work unfortunately.
Is there a way to set the console variable t.MaxFPS in C++?
I have tried GEngine->GetWorld()->Exec(GEngine->GetWorld(), TEXT(“t.MaxFPS 60”)), it doesn’t work unfortunately.
Solved!
int fps = 60;
IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("t.MaxFPS"));
CVar->Set(fps);
Does this work in a Shipping build?
Only two years after this question: But yes!
Just tested in a Shipped/Packaged game on both Windows and Android, and doing this approach has allowed me to set r.ShadowQuality.
(I tried doing sg.ShadowQuality, the actual property in GameUserSettings, but that doesn’t seem to either work, or work properly, or turn off ALL shadows - whereas being able to effect r.ShadowQuality does work)
My plugin does it, and much more:
It’s a full setting system + UI. It doesn’t use GameUserSettings. Instead, it’s my own central setting system which automates most of the work. New custom settings can easily be implemented and injected into it. All setting values are stored in INI and multiple user profiles are supported. Enjoy.