Saving and importing a group of objects from a json file for a game with level editor

I am making a game with a level editor. I have a group of objects called physics_objects. i need to store all their coordinates, rotation angles, and instance variables into a json file and then be able to import the previously saved json file to recreate all saved objects there. Is it possible without javascript knowledge and how to create this system? I asked ChatGPT to create a script for doing this, but it doesn’t work at all.

Create an event that iterates over all the objects in the physics_objects group, storing each objects details in a structure, and then jsonify that structure and save it as a file.

To create the object, read the file in and load the json into the variable - this will autmatically create the structure. Then iterate over each structure entry, recreating the object.

Something like:

1 Like

Oh, thanks! I will try this

Unfortunately, this system doesn’t work because I want to save multiple instances of one object, but it saves only one instance of every object