Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clones not deleting
- Purpleowlelliot
- New to Scratch
24 posts
Clones not deleting
Hi, so my project has a sprite where it creates clones of itself, and when it receives a broadcast, it's supposed to delete. For some reason it won't delete.
- deck26
- Scratcher
1000+ posts
Clones not deleting
So share the project please so we don't have to guess.
- Cool_Dude2022
- Scratcher
100+ posts
Clones not deleting
Hi, so my project has a sprite where it creates clones of itself, and when it receives a broadcast, it's supposed to delete. For some reason it won't delete.
I'm pretty sure you cannot delete a clone via a broadcast message. The code won't work if it looks something like this:
when I receive [Message v]
delete this clone
I would suggest setting a variable to delete the clone, something like this should work:
when I start as a clone
forever
if <(Delete Clone?) = [True]> then
delete this clone
end
end
Did I help you fix your problem? If so, please nominate my project to be featured!
If my code is used, credit is NOT required
- Anhkv
- Scratcher
15 posts
Clones not deleting
Use This: Hi, so my project has a sprite where it creates clones of itself, and when it receives a broadcast, it's supposed to delete. For some reason it won't delete.
when I start as a cloneLet me know if this was useful.
set [Delete Clone v] to [Yes]
when green flag clicked
forever
if <(Delete Clone) = [Yes]> then
Delete Clone
else
end
end
define Delete Clone
delete this clone
- mumu245
- Scratcher
1000+ posts
Clones not deleting
(#3)Yes you can delete clones from a broadcast. I just tried it.Hi, so my project has a sprite where it creates clones of itself, and when it receives a broadcast, it's supposed to delete. For some reason it won't delete.
I'm pretty sure you cannot delete a clone via a broadcast message. The code won't work if it looks something like this:when I receive [Message v]
delete this clone
I would suggest setting a variable to delete the clone, something like this should work:when I start as a clone
forever
if <(Delete Clone?) = [True]> then
delete this clone
end
end
- Purpleowlelliot
- New to Scratch
24 posts
Clones not deleting
For some reason even when i bring out the delete this clone block and press it it does not delete.
Here is the link: https://scratch.mit.edu/projects/961161093/ It was working before, i don't know why it isn't now. If you find an error in my code, please tell me.
Here is the link: https://scratch.mit.edu/projects/961161093/ It was working before, i don't know why it isn't now. If you find an error in my code, please tell me.
- Discussion Forums
- » Help with Scripts
- » Clones not deleting