• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • 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

A

Aleksi Laine

Guest
Hi.

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.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
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.
 
A

Aleksi Laine

Guest
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.
 
Top