# Set Class Defaults via C++

**URL:** <https://forums.unrealengine.com/t/set-class-defaults-via-c/445935>\
**Category:** UI\
**Tags:** unreal-engine, Scripting, Widget, question\
**Created:** [March 25, 2019, 7:40am UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935 "2019-03-25T07:40:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miroac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Miroac](https://forums.unrealengine.com/u/Miroac)\
**Post date:** [March 25, 2019, 7:40am UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/1 "2019-03-25T07:40:33Z")

</div>

Hi there everyone,

I’m tinkering with the new Editor Utility Widget and for the tool I’m trying to make I need to be able to save the Default Class Variables to update an array that the user would modify via the widget.

So I’m trying to see about creating a C++ Blueprint Library that would add a node for setting the Class Defaults similar to the Get Class Defaults node but can’t find any information about how to do this.

I just want to be able to override class default variables so that I can have the data self contained in a single asset instead of having to split it into multiple assets like datatables and the like.

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [March 25, 2019, 11:39pm UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/2 "2019-03-25T23:39:04Z")

</div>

Defaults are stored in class default object (CDO) and you can get it via UClass:

> **[UClass::GetDefaultObject](https://docs.unrealengine.com/5.1/en-US/API/Runtime/CoreUObject/UObject/UClass/GetDefaultObject/2/)**
>
> Get the default object from the class

It the same thing that Get Class Defaults returns

---

<div class="post-metadata">

**Author:** ![Miroac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Miroac](https://forums.unrealengine.com/u/Miroac)\
**Post date:** [March 26, 2019, 3:09am UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/3 "2019-03-26T03:09:56Z")

</div>

Wouldn’t this just get the defaults? I need to be able to set them

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [April 5, 2019, 5:46am UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/4 "2019-04-05T05:46:39Z")

</div>

Set varibles in CDO

---

<div class="post-metadata">

**Author:** ![mike\_patterson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mike\_patterson](https://forums.unrealengine.com/u/mike_patterson)\
**Post date:** [October 27, 2021, 2:03am UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/5 "2021-10-27T02:03:58Z")

</div>

Uh, yeah, the question is _how_

---

<div class="post-metadata">

**Author:** ![Oakkarwin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Oakkarwin](https://forums.unrealengine.com/u/Oakkarwin)\
**Post date:** [September 29, 2025, 5:43pm UTC](https://forums.unrealengine.com/t/set-class-defaults-via-c/445935/6 "2025-09-29T17:43:29Z")

</div>

Did we ever figure out a solution to this?
