Watched a Youtube video on how to create a save actor file. It works but it does not show how to save all actors, just one actor. I played with it for to many hours to count and got the save all actors to work but cannot figure out how to get them all to spawn. If there is a tire, box and crate in the game level you can press the “K” key and it will successfully save all 3 to a save file.
You can then press “L” key to reload the save file and 3 boxes will appear. It should be tire, box, crate, but I cannot figure out what to add to the “Class” for the “Spawn Actor”. If you click the arrow and choose box, it will spawn all boxes, even if you had 10 tire, 10 crates it will be 20 boxes, or if you change the “Class” to tires, then it will spawn 20 tires.
Can you think of anything to try to get the Actor classes from the save file so they can spawn correctly?
Add an array of Actor classes (this will be the classes you want to store). Be careful to pick “Class reference” and not “Object reference”. In the “Default Value” of that variable, choose the class you want to save. In the screenshots there are 3 entries “none”, specify your classes to save here. The “Saved Actor” is the structure you want to save / load.
Saving: Loop through the Actor classes, for each of them, get all actors of class, for each actor of class, add it to your Structure with its transform. Don’t forget to inject that information to your save game.
Loading: loop through your array of Actor Class / Transform and spawn such class at desired transform.
Hello Yun-Kun, thank you for the information! I see you have a YouTube channel for Tutorials, you should do one on saving all Actors in a level. There are only 2 video for this on YouTube and they are for saving only 1 actor. I could test the video for you
I setup the Blueprint Structure and added the Actor Class and Transform, and also added the array of Actor classes to the save file. Now when I press the “K” key to create the save file nothing happens. I am probably not injecting your code correctly into the save file, do you have any advice, see screenshot below.
PS: There is not even a tutorial on the web for this, no where I could find information on this. There are so many people asking about this but no one seems to have a answer. What would really be nice is a step by step tutorial on how to create the whole save system from start to finish.