Clones not deleting
id: 750679
category: Help with Scripts
posts: 7
Purpleowlelliot
loading
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
loading
So share the project please so we don't have to guess.
Cool_Dude2022
loading
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
Anhkv
loading
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
loading
(#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
mumu245
loading
Please, post the part of the code that is behaving weirdly so we can help you.
Purpleowlelliot
loading
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.