I encountered an issue where I used three scenes for my game: Start Game → In-Game → End Game. However, when I fail the game and try to restart, whether by saving/loading a game save or using the game reload function, I notice that objects from the previous scene aren’t cleared, causing lag. Although global variables in the project have been reset, the scene objects were generated using object spawning functions and bullet firing functions. I’m not sure if this is the reason they can’t be cleaned up, and scene transitions also seem problematic.
I’ve set all scene transition conditions to end the previous scene, controlled by other objects, but sometimes I encounter display bugs causing scene confusion—for example, after game over, it goes to the start interface, then game over again, then the in-game scene, leading to a lagging state. After a few seconds, the current scene objects are cleared, and the game restarts. This is very confusing.
I’m currently participating in a gamejam using AGM,Thank you very much for any help you can provide.