Discuss Scratch

Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?

If you have extra clones being made or code is being ran multiple times when only called once e.g are using clones to damage stuff and extra damage is being dealt. Your issue is most likely that you have a sprite with clones and you have code under any of these blocks in the sprite
when [… v] key pressed
when this sprite clicked
when backdrop switches to [… v]
when [… v] > […]
when I receive [Message v]
. Clones receive all of these hat blocks and run the code as well There are 2 solutions to this

Disclaimer: I will use “when I receive message” as an example since they are the most common issue however you could do the exact same with any of the other blocks I showed

1) make a “for this sprite only and check if clone

when green flag clicked
set [clone? v] to [false] //ensure the clone? Variable is “for this sprite only”

when I start as a clone
set [Clone? v] to [true] //ensure the clone? Variable is “for this sprite only”
when I receive [Make clone v] //name doesn’t matter
if <(clone?) = [false]> then //ensure the clone? Variable is “for this sprite only”
… //any code you don’t want other clones to run
end

Or

2) put the broadcast in a different sprite

when I receive [Make clone v] //in a sprite that has no clones and you don’t plan to make clones in it
… //any code can be put here

This feature can also be extremely useful however. Like if you want to update all clones at once you can just put one broadcast instead of having to make a variable to check if u need to update the clones

Other common cloning issues

1) no more clones being created. Scratch has a hard limit of 300 clones which cannot be changed. If you want to track how many clones you have u can do smt like this
when I start as a clone
change [Clone count v] by (1)
… // put whatever deletion requirements u need
change [Clone count v] by (-1)
Delete this clone

2) blocks not working on clones

Clones do not have any name so many blocks do not work such as
point towards [ v]
go to [ v]
(X position)
(Y position)
(Direction)
Or any other blocks that require sprite names. *NOTE sensing blocks like “touching?” Work for both clones and sprites
The workaround is a bit complex and changes for every block and I don’t want this topic getting too long. I would recommend checking out the workaround guide or asking for a workaround on the forum

Please make a separate topic for any questions not related to this post

Last edited by Scyth3d (Nov. 4, 2025 20:12:17)

N8_D_GR8_1
Scratcher
1000+ posts

iTopic - Issues with clones?

This should definitely be stickied. It would help so many users. I have a couple suggestion:

Even though the issue is most often with broadcasts, “when () key pressed” blocks, “when backdrop switches to ()” blocks, “when this sprite clicked” blocks and “when () is > ()” blocks could also cause this issue.

Also, I could see people who are new to the forums posting their questions here when they should be creating a new topic, so you should mention that a new topic should be created for any questions not directly related to this post.
Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?

N8_D_GR8_1 wrote:

This should definitely be stickied. It would help so many users. I have a couple suggestion:

Even though the issue is most often with broadcasts, “when () key pressed” blocks, “when backdrop switches to ()” blocks, “when this sprite clicked” blocks and “when () is > ()” blocks could also cause this issue.

Also, I could see people who are new to the forums posting their questions here when they should be creating a new topic, so you should mention that a new topic should be created for any questions not directly related to this post.
Ok ill update it thanks for the suggestions

Updated thank you

Last edited by Scyth3d (May 23, 2025 14:55:44)

10goto10
Scratcher
1000+ posts

iTopic - Issues with clones?

I defiantly think more should be done to get the word out about this very common pitfall. It might be helpful if the title was more specific to the problem people see. I think your first line of your text is specific but that’s only seen after someone opens your post.

I’m not good with titles but I’ll throw out a starting point “Please read if you are seeing more things happen, be created, or increase than you expect (cloning issues)?”

The other two pitfalls that keep people busy on this forum are the 300 clone limit and the clones can’t be referenced in blocks issue. I’m sure you don’t want your post to get so long people don’t read it but, if you are making a general guide on clone problems, maybe they could be briefly mentioned.
Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?

10goto10 wrote:

I defiantly think more should be done to get the word out about this very common pitfall. It might be helpful if the title was more specific to the problem people see. I think your first line of your text is specific but that’s only seen after someone opens your post.

I’m not good with titles but I’ll throw out a starting point “Please read if you are seeing more things happen, be created, or increase than you expect (cloning issues)?”

The other two pitfalls that keep people busy on this forum are the 300 clone limit and the clones can’t be referenced in blocks issue. I’m sure you don’t want your post to get so long people don’t read it but, if you are making a general guide on clone problems, maybe they could be briefly mentioned.
Ok is this title better (I didn’t feel like talking abt the other 2.) also wdym by clones can’t be referenced by blocks?
10goto10
Scratcher
1000+ posts

iTopic - Issues with clones?

Scyth3d wrote:

… also wdym by clones can’t be referenced by blocks?
Clones don’t have names. So they can’t be used in blocks like
point towards (name of clone)

Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?

10goto10 wrote:

Scyth3d wrote:

… also wdym by clones can’t be referenced by blocks?
Clones don’t have names. So they can’t be used in blocks like
point towards (name of clone)

Oh ok i was confused. Yea that makes sense although u can use sensing blocks. Should I just make en entire post on common clone problems?
10goto10
Scratcher
1000+ posts

iTopic - Issues with clones?

It’s hard to say. The clone problem that I see most often is the one you cover. You need a title that people with an issue might click on when they come to this forum. It must apply to them on first glance.

I would try going with just the one issue you cover in this topic and then asking Paddle2see to consider making this a sticky for a while to see if it helps with this extremely common (almost daily) request for help.
Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?

10goto10 wrote:

It’s hard to say. The clone problem that I see most often is the one you cover. You need a title that people with an issue might click on when they come to this forum. It must apply to them on first glance.

I would try going with just the one issue you cover in this topic and then asking Paddle2see to consider making this a sticky for a while to see if it helps with this extremely common (almost daily) request for help.
I am online on forums a lot and I think this question is like 25% of posts lol
Paddle2See
Scratch Team
1000+ posts

iTopic - Issues with clones?

This topic is now linked to a Sticky topic - so it's been renamed as an iTopic to remind us of that fact. Congratulations!
zedero
Scratcher
32 posts

iTopic - Issues with clones?

If you want to point to a clone, store its position in something public like a list, then point towards those coordinates using
define point coords(x)(y)
point in direction (([atan] of ((((x)-(x position)) / ((y)-(y position))))::operators) + (<[y] < [y position]> * (180)))

Last edited by zedero (May 31, 2025 21:33:18)

vaishalib819
Scratcher
5 posts

iTopic - Issues with clones?

I agree. This should be stickied
_Mega-Man_
Scratcher
2 posts

iTopic - Issues with clones?

Hey, I'm making an evolution game and I want to make individual stats for them(like speed, size, maturing rate), and for that, I need individual variables for sprites. One organism of a species might have 5 speed, while another of the same species might have 3. How do you do that?
when I receive [The Answer]
add [The one who answered my question] to [Credits]
_Mega-Man_
Scratcher
2 posts

iTopic - Issues with clones?

Anyways how are you all doing?

Last edited by _Mega-Man_ (Nov. 12, 2025 17:06:36)

Scyth3d
Scratcher
500+ posts

iTopic - Issues with clones?






In the future please make a new topic. But when you are making the variable check “for this sprite only” this will make a local copy for the clones

Last edited by Scyth3d (Nov. 14, 2025 17:23:00)

ttg_official1
Scratcher
3 posts

iTopic - Issues with clones?

what

Powered by DjangoBB