I’m working on a input configuration system for my game, and I’ve hit a bit of a snag. The system is set up to collect changes to the input config, then save them all at once. This works fine except when the player makes a change that only contains removal of default mappings/config. Adding new ones works. Removing defaults and adding customs in the same save works. Adding customs, saving, then removing those customs works. But as soon as the only change is going to a subset of the default configuration, the entire section (AxisMapping, ActionMapping, or AxisConfig) gets blasted. If the player proceeds playing the game, everything works fine. However, once the game is closed, those changes are lost. This is the case for all three sections, too. Here’s an example of one of my removal functions:
bool UInputConfig::RemoveActionMapping(FName actionName, FKey oldKey, bool ctrl, bool shift, bool alt, bool cmd)
{
UInputSettings* Settings = UInputSettings::StaticClass()->GetDefaultObject<UInputSettings>();
if (!Settings) return false;
FInputActionKeyMapping oldAction(actionName, oldKey, shift, ctrl, alt, cmd);
Settings->RemoveActionMapping(oldAction);
return true;
}