Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Cloning suddenly stops working-CLONES WON'T SPAWN
- uzytpl
-
38 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
How? The number of clones allowed is across the whole project so if you hit the limit your new sprite wil also stop cloning. That experiment proves it
But you said that the number of clones allowed is 300. I started doing the debugging process I already deleted all the other sprites that created clones and the bug still occurs. The number of clones at the same time doesn't even reach 50, so that can't be the problem
Also is the limit 300 clones ever created or existing at the same time? Cause I have my clones delete themselves when they are not needed anymore.
Do the already deleted clones still count for the limit or do they not?
- uzytpl
-
38 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
You have thousands of blocks across 75+ sprites. That is just too much to expect someone to help here. I think you have to try my suggestion of producing a simpler copy.
Don't worry, I am not expecting someone to magically fix it. I am aware that it's impossible for someone who sees my project for the first time to do.
I just posted this question hoping that someone would recognize the issue, so that I know what I'm supposed to fix.
But like I said even though I deleted all sprites that could possibly make clones the bug still occurs and I am really surprised to see it.
- deck26
-
1000+ posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Create a custom block in each sprite to decrease a global counter variable and then delete the clone. Use that wherever you currently have ‘delete this clone’. Similarly add a new ‘when I start as clone’ script to every sprite which increases the same variable by 1. Assuming you don't miss any that is the only sure way to track the number of clones. You may have given it conditions to delete clones but you don't know they've been deleted.
I'd be very surprised if you don't find you're creatign more clones than you think you are. At that stage you could add a separate counter and try counting separately for one sprite at a time. Make sure you use global variables for these test variables.
I'd be very surprised if you don't find you're creatign more clones than you think you are. At that stage you could add a separate counter and try counting separately for one sprite at a time. Make sure you use global variables for these test variables.
Last edited by deck26 (July 8, 2020 13:38:35)
- uzytpl
-
38 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Oh my God I'm such a dummy-dum-dum! The problem indeed was with the clone limit. You were right! I looked in the wrong place, the problem was that one time when I was trying to reduce the number of sprites, I made one sprite clone itself once at the very beginning, so that I wouldn't have to have 2 sprites that did basically the same thing. When I noticed that it didn't make a difference, I changed it back to normal, created the other sprite, but forgot to remove the “create a clone” block from the other one, yet removed everything else! So it was making infinite clones! Haha
Thank you so so much! Without you I would have lost all hope a long time ago
! Thank you thank you thank you for your help!!!!
Thank you so so much! Without you I would have lost all hope a long time ago

- uzytpl
-
38 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
It is now working again!
- deck26
-
1000+ posts
Cloning suddenly stops working-CLONES WON'T SPAWN
If clones create OK and then don't it can only be because a script has stopped running or the limit has been reached. The limit is far more often the cause so it's just a case of convincing the coder that that is the case! Oh my God I'm such a dummy-dum-dum! The problem indeed was with the clone limit. You were right! I looked in the wrong place, the problem was that one time when I was trying to reduce the number of sprites, I made one sprite clone itself once at the very beginning, so that I wouldn't have to have 2 sprites that did basically the same thing. When I noticed that it didn't make a difference, I changed it back to normal, created the other sprite, but forgot to remove the “create a clone” block from the other one, yet removed everything else! So it was making infinite clones! Haha
Thank you so so much! Without you I would have lost all hope a long time ago! Thank you thank you thank you for your help!!!!
- uzytpl
-
38 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Thank you for your help and insane patience! I'm so glad you're here to help us 

- deck26
-
1000+ posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Incidentally I noticed in one sprite you had
That should never be necessary. Either you're changing rotation style or you're not. If not this can be set in the sprite and forgotten about. If it does change you're setting up a conflict and either shouldn't be changing it or shouldn't be resetting it forever!
You have too many forever loops as it is without having something like that.
That should never be necessary. Either you're changing rotation style or you're not. If not this can be set in the sprite and forgotten about. If it does change you're setting up a conflict and either shouldn't be changing it or shouldn't be resetting it forever!
You have too many forever loops as it is without having something like that.
- Paigeri
-
500+ posts
Cloning suddenly stops working-CLONES WON'T SPAWN
*the limit is 300 per project. By any chance, are you trying to spawn unlimited clones? Scratch has a limit of 100 clones. I can't load the project, scratch throws an error.
- M0D_GAMRTHREE-STOP
-
4 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Why flame in my project not spawn even if there is 0 clones
- M0D_GAMRTHREE-STOP
-
4 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Oh i fixed it
- 098765432154321
-
500+ posts
Cloning suddenly stops working-CLONES WON'T SPAWN
Please make your own topic instead of necroposting on an old one if you find another problem. Why flame in my project not spawn even if there is 0 clones
Oh i fixed it
- Alexander_IV6_02
-
9 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
my project only haves about 63 clones. then why couldn't i delete the clones?
- C_Dog777
-
1 post
Cloning suddenly stops working-CLONES WON'T SPAWN
I just had the same thing on my game, but at the VERY start there is a piece of code that clones ONCE when you press the flag, and it just doesn't work. Neither does cloning for the rest of the game.
- METEROID10
-
23 posts
Cloning suddenly stops working-CLONES WON'T SPAWN
I made a project which is still unshared but when I make a certain amount of clones sometimes the clones don't spawn even if most of them are deleted.
soo aNnOyInG pls help
soo aNnOyInG pls help
Last edited by METEROID10 (May 24, 2022 19:47:32)
- Discussion Forums
- » Help with Scripts
-
» Cloning suddenly stops working-CLONES WON'T SPAWN