I’m trying to save and load the animation of a building that the player can save and delete. I’ve tried following the tutorial, but the animation changes all of the objects instead of only one.
I was hoping for it to follow the array variables and only change it’s own costume, but it didn’t. It changes them all. I read another post about this, but I didn’t understand the solution.
When creating objects immediately after deleting them is best to place the add object events on different subevents and not as subevents of the delete action.
Objects aren’t deleted immediately. They’re deleted after the end of an event or subevent. So, in that split second, there are both the original objects and the scene objects. That can sometimes cause problems.
I thought that the wait action was there to give GD the time to delete the objects but that’s actually creating the problem. Removing the wait action also seems to fix it. Although, the original objects are still present when the new objects are selected.
Even though it seems to function when the wait is removed, it’s safer to make sure the deleting and adding are done on seperate events and not as a subevent of the delete event.
I just noticed that I set the index variable to 0 twice. It only needs to be set once.