Saving/loading an array of placed objects

I am making an application for my sister-in-laws landscaping company. The goal of the app is to place objects and then move, rotate, scale and change their color through a dynamic material instance. I have all of the basic mechanics in place including placing, moving, rotating, scaling and color changing (achieved through a custom made color picker in UMG), as well as destroying objects and changing between a top down and first person camera. All I have left to do is add more objects to place and figure out the save system. I am trying to work out the saving with one type of object at first and then iterate from there for future objects. I get all actors of class and store them in an array, I save the array and can spawn the array but when I try to pull the location of the actor from the array it doesn’t work and just spawns them to center of the screen. I know the array is working to some extent because it will save and spawn the correct number of the object but all at the origin.

Do I have to somehow add the location and other properties like the color change to the array after it is created? or what is stored initially in the array? is it just simply counting how many instances of that class there are?

(Note: I am using version 4.4 for this project)

Get location pulls the current location.

I am not entirely sure what you are doing but if you try to spawn them after starting the level new this won’t work.

The easy solution would be creating another array for each stat (location, color scale, rotation) and place them at the same index of the array.

Then simply spawn the object via a for each loop and use the index from this one to get all the stays from the other arrays.

Hope this helps :slight_smile:

I am trying to do the load after the program has been closed and re-opened. I will try making the separate arrays and report back. I had a suspicion this would be what I would have to do but wanted to make sure I wasn’t missing something that was easier.

Can I make an array of transforms that would store location, rotation and scale in one array?

Definitely!

A transform would actually be better in every way!

I got it all working, thank you for your help.

Could you please show the BP example on how did you do this? I’m with the same problem