Delete This Clone
2.0 Delete This Clone.png
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, you can use this block to delete it. (This will only delete the clone under the script starting with the "When I start as a clone" block.)

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 bullet after being shot
when [space v] key pressed
create clone of [bullet 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) secs
change [sprites to find v] by (-1)
delete this clone
  • Deleting all of the clones in a project for an event.
broadcast [delete clones v]
...

when I receive [delete clones v]
delete this clone

See Also