This function will clear a room of all instances (no destroy events shall be called for the instances that are being removed).
NOTE Calling this function on a room asset created in The Asset Browser will permanently clear the room of instances, and even calling game_restart will not return the room to its original state. Only ending the game and opening it again will start with the room in its original state again.
room_instance_clear(index);
Argument | Type | Description |
---|---|---|
index | Room Asset | The index of the room to clear all instances in. |
N/A
global.rm = room_add();
room_assign(rm_base, global.rm);
room_instance_clear(global.rm);
The above code will add a new room to the game and then copy the contents of the room indexed as rm_base into it. It will then clear all instances from this new room.