UE Editor #1
Custom Configuration in Unreal Engine's Project Settings
If you're a developer working with Unreal Engine and want to add custom configuration settings to the Project Settings, this guide will walk you through the process. Custom editor configurations can be incredibly useful for making your tools and workflows more flexible and tailored to your project needs. By integrating custom settings into Unreal Engine’s Project Settings, you can manage important variables directly within the editor, making it easier for your team to configure and modify project-specific settings.
Setting Up Your Project for Custom Editor Configuration
To illustrate how to integrate custom settings into the Unreal Editor, let’s walk through setting up an EditorStarterModule
and configuring project settings
Step 1: Creating the Editor Module
The first step in adding custom configuration to Unreal Engine's Project Settings is to create a new module specifically for editor purposes. This module, which we'll name EditorStarterModule
, will contain all the necessary code to register and manage your custom settings within the editor.
Module Type: Editor
Step 2: Structuring the Module
Once the module is created, you need to structure it properly to keep your project organized. Your folder structure for the EditorStarterModule
should look like this:
The EditorStarterModule.cpp file will be the main location for your editor-related code. This is where you will set up and manage the integration of your custom settings into the Unreal Editor.
Step 3: Creating a Configurable UObject
The next step is to create a UObject
class that will hold all the configuration variables you want to expose in the Project Settings. These variables will be accessible and editable directly from the Unreal Editor, allowing you to customize your project without diving into the code.
Here’s an example of how to set up a configurable UObject:
This UObject
class defines a configuration setting (testString
) that can be edited from the Project Settings under a custom category.
Step 4: Integrating the Settings into the Editor
To make your custom settings available in the Unreal Editor, you need to register them within your module’s StartupModule
function. This is done using the ISettingsModule
, which provides the necessary functionality to add custom settings to the Project Settings.
Include the following code in your module:
In this example, the StartupModule
function registers your custom settings so they appear in the Project Settings under a specified category. The ShutdownModule
function ensures that these settings are properly unregistered when your module is unloaded.
Step 5: Accessing the Settings
To access and use the settings you’ve configured, you can retrieve them anywhere in your code using the following syntax:
This allows you to programmatically access the settings defined in your custom UObject, making it easy to use these configurations throughout your project.