• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE [SOLVED] Object Gets Destroyed


I have a strange problem. This happen only in one of my projects so I think it's a bug. When I use goto_room, the topmost object on the object list in Game Maker Studio 2 gets destroyed. It doesn't matter which object it is. This isn't on a big problem and can easily be fixed by adding an extra sacrificial object to the maker.


ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Add show_error("hold up", false) to any such object's Cleanup event, run the game in Debug mode, and you'll be able to see what destroys the object in the "Call stack" window.
I managed to fix the issue. I have a variable my1 which got set in the creation even to 0 and for some reason that destroyed it. I set it to -1 and now it doesn't get destroyed any more. The error message showed the place. Still not sure why it did that. Memory leak? Thanks for the help.