I have tried following the tutorial on save/ load but I it is not giving the result I am hoping.
I have an object group called “Draggable”.
In this group I have for the moment three objects.
In my scene I have multiple instances of these objects.
I have a save button that should save the X,Y of each instance.
The next time I preview the game the position of the objects should be set from the save.
-the issue is that all the instances start at the same x,y position instead of there individual ones.
Thanks for the idea.
I will try using your method tomorrow to see the difference. But I can imagine that what I am doing could give an issue when loading the game as the object instance might not know witch instance gets witch ID…
Just to wrap up my method…
I have manually set an ID variable for each instance (1,2,3…)
Instead I would like to loop through and give all an ID.
Could I do it like this?
Thank you for the feedback. You are a more experienced developer than I, so I know that you are pointing out something I need to deal with. I have read your comments several times and do see that saving the IDs might not solve anything. But there is a gab between me seeing it and me understanding it… I might have to work on some other problems before I return to the saving things and hopefully I have a better understanding. Is it because you think that the ID is completely redundant?
A thing I am struggling with understanding is that at the moment I have premade the layout of different objects in the editor. My head dos not understand how there is a coupling between the right object at the right position and with the right value of the status-variable (not all objects have a status-variable).
I will probably end up giving the player total controle of creating new objects and deleting old ones. From what I understand from your posts I should give the new object instance an ID on creation.
Only if you never reference the ID in any of the events (other than saving and loading). If you don’t use it, why bother saving it? And if you do use it, is it to identify it when dragging (no need to save), or to create a connection between this object and another (in which case do save it)?
What I do with the objects is clear them all out of the scene before I load the saved position details. These details include the object name, so then I can create the object from the group. I only store IDs if 2 object need to be connected/linked (I use the Sticker extension).
Yes, but (again) not if the IDs are used to link 2 objects.