DeveloperSettings is a class which allows you to set up a custom configuration page into the Project Settings menu. This is extremely convenient for setting up configuration options or linking actors into C++ classes which otherwise wouldn’t be able to get simple references from editor, amongst other things.

Setup

Extend UDeveloperSettings. See the existing subclasses for configuration options on how to make it show in various ways in Project Settings

UCLASS(Config=Game, DefaultConfig, DisplayName="Foo")
class YOUR_API UMyDeveloperSettings : public UDeveloperSettings 
{
	GENERATED_BODY()
	
public:
	UPROPERTY(Config, Category="Whatever")
	bool bSomeProperty;
}

UCLASS attributes:

  • Config: controls which main section in project settings this is shown. Valid choices are same as the sections in project settings: Game, Project, Engine, Editor, Platforms, Plugins
    • It might be possible to also provide a custom value, which makes the data save into a custom config file and generates a custom section in project settings for it
  • DisplayName: text shown in project settings for this settings class

UPROPERTY attributes:

  • Use Config or the property won’t get saved into the config file, making it useless
  • Category can be used to group properties within the project settings page

Use GetDefault to access:

const UMyDeveloperSettings* Settings = GetDefault<UMyDeveloperSettings>();

The DeveloperSettings class is automatically registered and handled. No other configuration is necessary for it to show up in project settings.

Blueprint access

Use a Blueprint Function Library with accessors to work around.

UFUNCTION(BlueprintCallable, BlueprintPure)
static UMyDeveloperSettings* GetMyDeveloperSettings();
 
/* */
 
UMyDeveloperSettings* UMyFunctionLibrary::GetMyDeveloperSettings()
{
	return GetDefault<UMyDeveloperSettings>();
}

Returning the default object will allow accessing any members in blueprints which have been declared BlueprintReadOnly or BlueprintReadWrite. You can also just return individual values from the developer settings object.

Other useful features

  • There is a delegate which fires when settings are updated. Use GetMutableDefault<UMyDevSettings>()->OnSettingsChanged() to access it.
  • You can create a custom settings screen by overriding GetCustomSettingsWidget. Using this will replace the default settings screen. The standard settings UI is created via an SDetailsView, so it may be possible to construct it yourself and include other parts in it as well, however I’ve not looked into it that deeply.

Gotchas

  • Use TSoftObjectPtr or other Soft References when properties link to assets or classes. Depending on things, a hard reference may cause loading errors due to the order things get loaded in