UE 4.27 - Saving all actors of a type and their locations

Hey @Bugbuh!

So what you will want to save is the transform of the enemies. That’s Location, Rotation, and Scale as one variable, just to make it easy.

So you’ll use GetAllActorsOfClass (or any other methods of getting them as an array) then on a ForEach loop, in the body of the loop use a “GetTransform” for the actor and add THAT to an array(or you can use a map). This will get the indexes to match 1:1 on both arrays.

Then when loading, when you spawn each member of the Enemy class, you’ll pull the index on your spawning ForEach loop, and for each Enemy Actor, SetTransform using that array you saved and the index from the spawning Enemy!

Saving current level as a variable would be based on the name of the level- check this thread for instructions on that. :slight_smile: