• 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!

Windows How To Destroy Previous Object If I Have The Second One

H

How_To_Do_It?

Guest
I want to know how to destroy previous object if I have the second one. I've tried to do it using instance_id but nothing didn't work. Say in advance, thanks everyone for help :3
 
If you mean having a singleton, you can just check if more than one exists with instance_number(), and act accordingly (i.e destroy the duplicates or create an instance if none exists) according to that.
 

Roldy

Member
I want to know how to destroy previous object if I have the second one. I've tried to do it using instance_id but nothing didn't work. Say in advance, thanks everyone for help :3
I think you will need to be more clear about what you are asking. Give an example of what you are trying to do.
 
H

How_To_Do_It?

Guest
I create a new object with button and if I have more than 1 of these instances I need to destroy the previous object (first created)
 
Top