Delete This Clone | |
delete this clone | |
Category | Control |
Type | Cap |
Introduced in | 2.0 |
The Delete This Clone block is a control block and a cap block. It deletes the clone it runs in. This block is the only way, besides clicking the Green Flag or Stop Sign, to delete clones. When a clone is created, this block can be used to delete it at a later time.
Example Uses
Clones are not often meant to last until the Green Flag or Stop Sign are pressed; this block will delete it.
- Delete a projectile after being launched
when [space v] key pressed create clone of (projectile v)
when I start as a clone point towards (mouse-pointer v) repeat until < <touching (edge v)?> or <touching (target v)?> > move (3) steps end delete this clone
- Removing sprites that have been found in a hide and seek game
when gf clicked set [sprites to find v] to (10) repeat (sprites to find) create clone of (Sprite1 v) end
when this sprite clicked say [You got me!] for (2) seconds change [sprites to find v] by (-1) delete this clone
- Deleting all of the clones in a project for an event (clones receive broadcasts too)
broadcast (delete clones v) ... when I receive [delete clones v] delete this clone
- Sending a broadcast that will delete all clones and have the main sprite do something
broadcast (delete clones v) ... when I receive [delete clones v] if <not <>> then // This allows for bypassing cap block limits without the need to make a separate script delete this clone end ...