Legacy GM Tell object to do something if it is destroyed?

D

Dibidoolandas

Guest
I feel like this should be simple but I haven't found a solution. Basically I want to tell an object to do something if it's destroyed.

Specifically, I tell destructible blocks to create particle effects when they break. Right now I handle this by telling them to make the particles when their "hp" drops in value. So basically if hp != old_hp > create_rock_particles();, and then if hp == 0, instance_destroy();

However, this would be a lot easier to tell other objects that interact with them to just "instance_destroy();" and tell the blocks that if they are destroyed, to create_rock_particles() on their way out.

Any way to accomplish this or am I stuck finnicking with the hp system? Thanks in advance.
 
Top