Delete Clone Block not working? (Or is it just my code...?)


This project here, called Spinny G​un isn’t working.

You just tap to shoot the g​un, and if you miss the orange targets, you lose. I don’t understand why the bullets aren’t being deleted when they hit the squares/targets. The ‘Targets’ object is setting a variable to one when it is within 25p of the bullet. The bullet then recognises that, and decides that it doesn’t feel like deleting itself for some reason. @CodeHelp.
Thanks in advance.


That’s odd…I tried experimenting a bit but I think you’ll have to use the box method to destroy the object.

Like this

When (Self X Position) > 1014) or (Self X position) < 10) or (Self Y position) > 768) or (Self Y position) < 0)

Destroy Object


Doing the same for the square x and y position, this should work.

Odd. It doesn’t.


I think you ran into this issue: if you delete an object, you cannot reference its collision or orange values anymore. Otherwise the game freezes


Ok I got it. Gimme a moment

Under Score, when bullets bumps track should not set play to 0 (that stops everything), I think it should be bump, but change that

Wait no

something is wrong with the collision system. Bullets getting destroyed freeze the project, and the tracks don’t clone successfully – use the destroy block sparingly


Lemme take a look at it…

1 Like

What does that mean I should do in my code though?


I think that it’s because the destroy object block destroys the first clone… otherwise idk


I don’t really know. But the destroy should be executed at a different time, and the targets don’t seem to reappear, what is the point of destroying them instead of just re-positioning them

1 Like

Oh, I think that maybe it’s because Hopscotch only has the “create a clone” block. If you want to delete clones, you can do that on Scratch.


  • The “delete clone” block is an end block, so you cannot put any scripts after it in a line of code.
  • If you want to use it, you will have to make sure the starter rule says “when I start as a clone”.
1 Like

:man_facepalming: :man_facepalming: :man_facepalming: :man_facepalming: :man_facepalming: :man_facepalming:
come on now, you have not heard of JSON editing?

1 Like

That is correct, The Incredible Mr. E.


There is a secret block called delete clones mate

1 Like

…and a secret block called Destroy Clone that can be accessed via json editing (I think it’s json editing at least)


Yup thats right

1 Like

Yeah. I don’t use json editing, so that was all I had to say.