# How can I reset to default blueprint my variables?

**URL:** <https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546>\
**Category:** Blueprint\
**Tags:** reset-to-default, unreal-engine, editor, CPP, question, Blueprint\
**Created:** [July 1, 2019, 1:13pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546 "2019-07-01T13:13:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![YamikaDesu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YamikaDesu](https://forums.unrealengine.com/u/YamikaDesu)\
**Post date:** [July 1, 2019, 1:13pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/1 "2019-07-01T13:13:41Z")

</div>

Hello, I want to reset my variables in code C++ as default blueprint like UE4 Editor do when you press the yellow arrow in editor

![281240-untitled4.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/3/7/1371178b06968596923b5c3cb0939edeb202fdc8.png)

Does anyone know how can I do it?

---

<div class="post-metadata">

**Author:** ![KristofMorva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kristofmorva/32/1194508_2.png) [@KristofMorva](https://forums.unrealengine.com/u/KristofMorva)\
**Post date:** [July 1, 2019, 3:45pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/2 "2019-07-01T15:45:04Z")

</div>

You probably can’t do it built-in for in-game, as it’s Editor code, see `FPropertyValueImpl::ResetToDefault()` and `FPropertyNode::GetDefaultValueAsStringForObject` for example.

You can always of course write your own logic to do it, depending on what do you want to achieve exactly.

---

<div class="post-metadata">

**Author:** ![YamikaDesu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YamikaDesu](https://forums.unrealengine.com/u/YamikaDesu)\
**Post date:** [July 1, 2019, 5:00pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/3 "2019-07-01T17:00:53Z")

</div>

I just want it for Editor Widget Code (not in-game), so is there any way to do it or what does Unreal Engine 4 inside to do that?

---

<div class="post-metadata">

**Author:** ![KristofMorva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kristofmorva/32/1194508_2.png) [@KristofMorva](https://forums.unrealengine.com/u/KristofMorva)\
**Post date:** [July 2, 2019, 1:04pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/4 "2019-07-02T13:04:45Z")

</div>

Well if you are planning to do an Editor Utility Widget, I’m sure there isn’t anything like this built-in to Blueprints.

As for C++, these codes seem to be quite specific to the Properties (and most of them are probably private / public anyways). You can dig the engine source if you can accidentally find anything useful that is both exported and accessible, but it seems unlikely for me based on the functions I have mentioned above.

---

<div class="post-metadata">

**Author:** ![YamikaDesu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YamikaDesu](https://forums.unrealengine.com/u/YamikaDesu)\
**Post date:** [July 3, 2019, 3:24pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/5 "2019-07-03T15:24:48Z")

</div>

I just do it getting the actor like this

```
AActor* blueprintActor = cppActor->GetClass()->GetDefaultObject<AActor>();

```

and set the values directly to blueprintActor, the problem is it is not set as dirty so the data is not saved when I close and open the editor, do you know something that I can do to set this to dirty?

---

<div class="post-metadata">

**Author:** ![KristofMorva](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kristofmorva/32/1194508_2.png) [@KristofMorva](https://forums.unrealengine.com/u/KristofMorva)\
**Post date:** [July 3, 2019, 3:27pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/6 "2019-07-03T15:27:28Z")

</div>

I believe you can use `blueprintActor->MarkPackageDirty()`.

---

<div class="post-metadata">

**Author:** ![YamikaDesu](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YamikaDesu](https://forums.unrealengine.com/u/YamikaDesu)\
**Post date:** [July 3, 2019, 4:17pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/7 "2019-07-03T16:17:49Z")

</div>

It works! Thanks you so much!

---

<div class="post-metadata">

**Author:** ![blindminds](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/blindminds/32/1213160_2.png) [@blindminds](https://forums.unrealengine.com/u/blindminds)\
**Post date:** [April 4, 2025, 3:47pm UTC](https://forums.unrealengine.com/t/how-can-i-reset-to-default-blueprint-my-variables/451546/8 "2025-04-04T15:47:06Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/8/278755c70bf7e998d9617059ccfe6971089cb2f0.png)  
Is this a better solution for anyone?
