# How to keep UPROPERTIES changed through C++ in a Level Actor Instance Persistent between Editor Sessions?

**URL:** <https://forums.unrealengine.com/t/how-to-keep-uproperties-changed-through-c-in-a-level-actor-instance-persistent-between-editor-sessions/1730821>\
**Category:** C++\
**Tags:** unreal-engine, level, editor, question, CPP\
**Created:** [March 5, 2024, 1:46am UTC](https://forums.unrealengine.com/t/how-to-keep-uproperties-changed-through-c-in-a-level-actor-instance-persistent-between-editor-sessions/1730821 "2024-03-05T01:46:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![IrSoil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IrSoil](https://forums.unrealengine.com/u/IrSoil)\
**Post date:** [March 5, 2024, 8:07am UTC](https://forums.unrealengine.com/t/how-to-keep-uproperties-changed-through-c-in-a-level-actor-instance-persistent-between-editor-sessions/1730821/2 "2024-03-05T08:07:48Z")

</div>

I don’t know the proper solution on this, but i solved it via `Editor Utility Widget` where on button click i’m:

- getting all relevant actors;
- set them guids if there is none;
- [mark all the relevant blueprints dirty](https://forums.unrealengine.com/t/editor-utility-widget-how-to-save-changes-solved/821338/2) so that editor could see changes were made
- manually call “save all” (ctrl+shift+s)

Not 100% automated, but this solves the problem for me for now.

I did try to do it “properly”, but there was so much problems that it isn’t worth further research for me.  
fyi the problems to consider:

- guids regenerating each time object is moved;
- guids not regenerating on actor duplication (like alt+move);
- guids regenerating on each blueprint compilation.

upd: a year later:  
Turns out there is an `UObject::PostEditImport()` function that got called whenever you need: on placing\dropping actor into the level, on duplication, on copy-pasting… so it seems it’s a way to solve the original problem

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-keep-uproperties-changed-through-c-in-a-level-actor-instance-persistent-between-editor-sessions/1730821)._
