# How to sync TArray elements value between editor and runtime

**URL:** <https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636>\
**Category:** C++\
**Tags:** unreal-engine, CPP, question\
**Created:** [December 19, 2023, 5:20pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636 "2023-12-19T17:20:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kontikiki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kontikiki/32/1076844_2.png) [@Kontikiki](https://forums.unrealengine.com/u/Kontikiki)\
**Post date:** [December 19, 2023, 5:20pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/1 "2023-12-19T17:20:43Z")

</div>

Hi I have subclass of USaveGame; Inside I have declared UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = “Settings”)  
TArrayHDRIArray; Now if add elements to array at runtime they don’t show in editor mode. So for example the array is still showing with zero elements. But at runtime the data is there . Is there a way to be able to sync this somehow with editor utility or scripting or force it with console command? Thanks in advance for your reply.

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [December 19, 2023, 11:43pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/2 "2023-12-19T23:43:04Z")

</div>

What are you looking at in the Editor? The editor deals with ini and uasset files. I’m guessing your looking at the blueprint of your USaveGame child class. Are you looking at it while PIE is running? You might not have the debug instance selected in the upper-right of the blueprint. If PIE isn’t running, then I wouldn’t expect you to be able to see anything. I’ve never heard of an editor utility for inspecting save games.

---

<div class="post-metadata">

**Author:** ![Kontikiki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kontikiki/32/1076844_2.png) [@Kontikiki](https://forums.unrealengine.com/u/Kontikiki)\
**Post date:** [January 8, 2024, 12:55pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/3 "2024-01-08T12:55:45Z")

</div>

Yes I am looking at USaveGame blueprint child class. So basically you are saying there is no way of having access to the elements of the array in editor despite they exist at runtime? I would like to be able to see how many element are there and edit them in editor and equally at runtime. I don’t understand what you mean with debug instance selected.

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [January 8, 2024, 1:54pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/4 "2024-01-08T13:54:24Z")

</div>

> [@Kontikiki](#):
>
> edit them in editor

Yeah, that’s not a thing. At least not by default, you’d have to write custom tools for that.

Savegames are for the game, not the editor. So they should only be relevant when PIE is running (or you’re running a non-editor version of the game of course). You can debug and inspect your savegame _while your game is running_ but you can’t treat it as another asset type that you can just edit however you like.

---

<div class="post-metadata">

**Author:** ![Kontikiki](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kontikiki/32/1076844_2.png) [@Kontikiki](https://forums.unrealengine.com/u/Kontikiki)\
**Post date:** [January 8, 2024, 2:07pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/5 "2024-01-08T14:07:19Z")

</div>

Thank you for the reply. If savegame is not designed for editor but game only, is there any other data type within Unreal(or plugin) that supports persistent data between sessions and can both be edited at runtime or editor?

---

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [January 8, 2024, 2:16pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/6 "2024-01-08T14:16:13Z")

</div>

You could maybe use a custom ini file to save out information for editor use

> [@How to store variables to a custom .ini file?](https://forums.unrealengine.com/t/how-to-store-variables-to-a-custom-ini-file/330274/6):
>
> This is an old question but I was having the same problem and happened across the solution, so I figured I’d post it for posterity. Here’s how it works: Your c++ class definition should look like this. UCLASS(config=NewConfigFileName) class YOURGAME\_API AExample : public AActor { GENERATED\_BODY() UPROPERTY(Config) int32 test\_number; UPROPERTY(Config) FString test\_string; } Edit: Oh and I almost forgot, you can have other properties in your UPROPERTY declarati…

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [January 8, 2024, 2:16pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/7 "2024-01-08T14:16:51Z")

</div>

Anything that you can edit in the editor has to be, by definition, session agnostic.

At best, you could use ini’s for some user data but that’s usually at the application level, settings and whatnot. What you’re editing in the editor are more like default values though. But nothing session specific. That’s stored in a save game and loaded by the game when needed. If you’re doing MP, maybe you have a database or something that you could edit while the game’s not running but again if you want to edit that from the editor it’s probably a custom tool.

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [January 8, 2024, 4:12pm UTC](https://forums.unrealengine.com/t/how-to-sync-tarray-elements-value-between-editor-and-runtime/1538636/8 "2024-01-08T16:12:35Z")

</div>

If it is just a one-time thing that you need to do, you can store the runtime values in an Actor instance, pause the simulation, select the actor, and sync its runtime values back to default (blueprint).

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/7/db72b76cde7e91b2493364c95291d65e2dc3e28a.png)

I think you need an Actor because I’m not sure if it is possible to select an object like this. But if you know how, then it could work too.
