# How to set project settings via C++?

**URL:** <https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147>\
**Category:** Mobile\
**Tags:** unreal-engine, editor, question, CPP\
**Created:** [August 24, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147 "2016-08-24T20:28:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NfrancisJ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NfrancisJ](https://forums.unrealengine.com/u/NfrancisJ)\
**Post date:** [August 24, 2016, 8:28pm UTC](https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147/1 "2016-08-24T20:28:02Z")

</div>

Is there a way to assign/create input settings via C++?  
Im talking about setting the Inputs that get set in the Project Settings. (MoveForward - “A” - Value 1), not the action binding.

Id like to create a template code that I can add to the gamemode which will create the inputs(when game starts), which I can later use when I create my character class and bind what was created.

side question:  
In general, how do I get/set things in the project settings? ie, DefaultPawn, Physics Settings(Gravity Z, 2d Physics)…and so on.

thanks

-Nick

---

<div class="post-metadata">

**Author:** ![staticvoidlol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@staticvoidlol](https://forums.unrealengine.com/u/staticvoidlol)\
**Post date:** [August 26, 2016, 12:14pm UTC](https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147/2 "2016-08-26T12:14:28Z")

</div>

Have a look at [Rama’s keybinding tutorial](https://wiki.unrealengine.com/Rebinding_Keys_At_Runtime_in_Packaged_Game#My_C.2B.2B_Code) - it contains the functionality you need.

As for the side question, I have no idea - I think in UE3 there were ini file settings for some of those, maybe worth having a look.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_354634ee](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_354634ee](https://forums.unrealengine.com/u/anonymous_user_354634ee)\
**Post date:** [May 7, 2019, 1:52pm UTC](https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147/3 "2019-05-07T13:52:59Z")

</div>

Here’s example code to answer the side question.

```
URendererSettings* Settings = GetMutableDefault<URendererSettings>();
Settings->CustomDepthStencil = ECustomDepthStencil::EnabledWithStencil;
Settings->SaveConfig();

```

This changes Project Settings \> Engine \> Rendering \> Postprocessing \> Custom Depth-Stencil Pass to Enabled with Stencil.

All project settings are UCLASSES with types that you can edit. You just have to find out which class your setting belongs to and the get it with GetMutableDefault and then set your property’s value and save.

I found out which class the Custom Depth-Stencil Pass setting was in by searching for the tooltip (surrounded by double quotes so you search for the complete line and not key words) you get when you hover over the setting in the Unreal Engine github repository. I searched for “Whether the custom depth pass” and found out that the Custom Depth-Stencil Pass setting was in Engine/Source/Runtime/Engine/Classes/Engine/RendererSettings.h contained in a class called URendererSettings.

---

<div class="post-metadata">

**Author:** ![Monoody](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Monoody](https://forums.unrealengine.com/u/Monoody)\
**Post date:** [November 5, 2024, 2:05am UTC](https://forums.unrealengine.com/t/how-to-set-project-settings-via-c/368147/5 "2024-11-05T02:05:56Z")

</div>

In UE 5.4，those code work for me.

```auto
URendererSettings* RendererSettings = GetMutableDefault<URendererSettings>();
	RendererSettings->bDefaultFeatureAutoExposure = !RendererSettings->bDefaultFeatureAutoExposure;
	FPropertyChangedEvent PropertyChangedEvent(URendererSettings::StaticClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(URendererSettings, bDefaultFeatureAutoExposure)));
	RendererSettings->PostEditChangeProperty(PropertyChangedEvent);
	RendererSettings->SaveConfig();

```
