Create Level save files from runtime Level Edits

Level Editing & Save in Play Mode?

During gameplay, (PlayMode in the Editor), the player (daughter) can move and add a few types of objects (prefabs) around in the level, in a sort of very primitive level editing, until she’s happy with it.

How do I save these changes and additions she’s made, during gameplay, in such a way that I can then load a daughter level within the editor and therein turn it into an actual level?

Can this same mechanism be used to help real world players edit, save and share levels?

Here is a great tutorial on saving and loading data from a file. It’s more focused on player stats, however it could easily be converted into a level saver, by simply changing the PlayerData to store a list of the object types and positions. This could be done by having all the game objects that you want to save have a tag ‘saveable’, and then when you run the save function, get the positions and rotations etc of the objects and save them to an array (in terms of what the object actually is, I don’t think you can just store a non-primitive, which means you will probably have to come up with a way around that; maybe by making up a list of all the objects and using a numerical id along with it.

Overall it is a complex thing to do, but it is totally possible, and would be even better if you can make it in game.

Link to the helpful tutorial: