Hey all! So for years I’ve been relying on the Game.ini file to save a variable between editor sessions. In my case the class is a custom camera actor with a setup similar to this (not a complete class, mind):
UCLASS(config=Game)
class ASomeCameraActor : public ACameraActor
{
GENERATED_UCLASS_BODY()
UPROPERTY(Config, EditAnywhere, BlueprintReadWrite)
float SomeFloat;
public:
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override
{
Super::PostEditChangeProperty(PropertyChangedEvent);
// Do some things here if needed
SaveConfig();
}
#endif
};
This no longer works in Unreal 5.1. With breakpoints I was able to see that unreal does try to save the property to the proper path and name, but no Game.ini file is ever created or changed. If I manually create the Game.ini file in /Saved/Config/WindowsEditor with the values and reload the project, they are loaded correctly BUT they still do not save to the config file when the property is changed.
As a test, I even changed SaveConfig();
to SaveConfig(CPF_Config, TEXT("Game"), GConfig, true);
and still no dice.
Did something change that we weren’t made aware of? I do not see anything like this in 5.1’s change notes. So far I can only think its actually a bug on Epic’s part.
(After some digging in UDN with work account)
Turns out this is indeed a bug with 5.1 due to UE tagging the config as NoSave. This will affect changes made during PIE and the editor itself (but not compiled builds?)