Destroys the specified instance. Calling the function with no arguments will destroy the instance that is currently in scope and running the code, but you can target a specific instance if you provide its ID, or you can target all instances of a particular object by using an object_index.
Available objects list→
Argument | Type | Description |
---|
ID | :real | The instance ID or object_index to destroy (optional, default is the calling instance) |
Example, called from article1_update.gml:
if (y > room_height + 100) {
instance_destroy();
}
Example, called from update.gml:
var my_article = instance_create( x, y, "article1" );
instance_destroy( my_article );