J
JapanGamer29
Guest
I just want to post this in case anybody else has the same problem.
I had an object disappearing for seemingly no reason. I wasn't destroying it or changing rooms. It just stopped running. By checking to see if it still existed, I realized it didn't! In my search for an answer I came across this archived thread on Reddit:
https://www.reddit.com/r/gamemaker/comments/6akx7u/gms2_object_disappearing_for_no_reason/
The user "damimp" suggested said:
It was destroying my game controller object in the first position of the resource tree!
A simple check put an end to a bug that has been bothering me for ages!
If you're out there, damimp, thank you!
I had an object disappearing for seemingly no reason. I wasn't destroying it or changing rooms. It just stopped running. By checking to see if it still existed, I realized it didn't! In my search for an answer I came across this archived thread on Reddit:
https://www.reddit.com/r/gamemaker/comments/6akx7u/gms2_object_disappearing_for_no_reason/
The user "damimp" suggested said:
Sure enough, I had this code destroying an unrelated object, or so I thought:It seems like there may be something up with your object's position in the resource tree. Consider code like this:
If something like this were floating around somewhere, it would cause the first object in the resource tree to delete itself.Code:with(0){ instance_destroy(); }
Code:
instance_destroy(global.itemAtGameStart[i]);
A simple check put an end to a bug that has been bothering me for ages!
Code:
if (global.itemAtGameStart[i] != 0) { instance_destroy(global.itemAtGameStart[i]); }