Custom Config file ignores the defaultconfig file

I have a game with a custom config file. Everything works fine in the editor. After packaging, I can run the game with no problems a first time, everything works. But the second time and beyond, it returns an empty config class. It also created the .ini files after the first launch of the game. If I delete the created .ini file, it works again.
Whats the idea behind that?

// Edit: If I use one of the default config files like “Game” instead my own .ini file everything still works after restarting the game.

If I replace
UCLASS(config=MySettings, defaultconfig)
with
UCLASS(config=Game, defaultconfig)

But I need to use the MySettings.ini file and don’t want to have it in the game.ini file.
Any advice?

Thanks.

1 Like

Apparently, it’s not a packaging problem. I think it works in the editor, because this always takes the default config. If I test it in standalone, the same issue appears.
As soon there is a MySettings.ini File, the DefaultMySettings.ini are completely ignored.
But, if I use the Game Config instead of my ustom config, it takes the difference between the defaultgame.ini and the game.ini. Which is what I need.
What do I have to do, that this works for MySettings.ini as well?

So, DefautlMySettings.ini is packaged to .pak file in

<YourGameProject>\Saved\StagedBuilds\WindowsNoEditor\<ProjectName>\Content\Paks

But it’s still not able to merge config file?

As a last resort, You should be able to call UObject::LoadConfig(…) and manually specific the path to config file.
There is also UObject::GetDefaultConfigFilename(…)