Baking Physics to UData (Moving code from Unity to UE4)

Hello I am converting a project from unity. And in this project I need to bake animations into UData.
What I actualy do is, spawn couple objects. Run these for couple frames. Sample their xyz location into an array for each frame (the frame rate is lockstepped at 16ms). So I can re run this baked physics interactions in game.

In unity I use scriptableobject(unity’s version of udata) I have a button that starts the game and spawns couple objects. And sample frame by frame. At the end I can run EditorUtility.SetDirty() to save this scriptable object.

In unreal i do something similair. I have an actor that has reference to the udata. I put it in an empty level. Run the level and sample frame by frame. At the end the udata has the baked data.
BUT!!! after restarted UE4 the data is lost.
So is there something like EditorUtility.SetDirty()? Also can I start level and spawn objects by pressing a button on custom editor?