# What's the class default object usage

**URL:** <https://forums.unrealengine.com/t/whats-the-class-default-object-usage/258144>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [October 29, 2021, 1:47am UTC](https://forums.unrealengine.com/t/whats-the-class-default-object-usage/258144 "2021-10-29T01:47:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_019\_5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@\_019\_5](https://forums.unrealengine.com/u/_019_5)\
**Post date:** [October 29, 2021, 1:47am UTC](https://forums.unrealengine.com/t/whats-the-class-default-object-usage/258144/1 "2021-10-29T01:47:45Z")

</div>

I know uclass will create cdo, but why have to create it? Just for get object default value?

---

<div class="post-metadata">

**Author:** ![and-rad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@and-rad](https://forums.unrealengine.com/u/and-rad)\
**Post date:** [October 29, 2021, 9:39am UTC](https://forums.unrealengine.com/t/whats-the-class-default-object-usage/258144/2 "2021-10-29T09:39:23Z")

</div>

The CDO serves as a template for new objects. Objects that are created at runtime are copied from the CDO. [See the documentation](https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/Objects/) for a little more info.

Neat uses for the CDO include resetting modified properties to their default values.

---

<div class="post-metadata">

**Author:** ![calebCoder](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/calebcoder/32/88713_2.png) [@calebCoder](https://forums.unrealengine.com/u/calebCoder)\
**Post date:** [October 31, 2021, 3:52am UTC](https://forums.unrealengine.com/t/whats-the-class-default-object-usage/258144/3 "2021-10-31T03:52:56Z")

</div>

The CDO is created automatically for every class (as long as it inherits from UObject I believe)

They should always be valid as long as the engine is running and are super useful for things like grabbing the default value of some variable for a certain class. That’s what I use them for most often.
