Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Make a variable for just one clone
- logais
-
Scratcher
100+ posts
Make a variable for just one clone
I am trying to make a project using cloning and I need to have a separate variable for each clone, so I was wondering if anyone knows how to do this and can help me. 

- Pufferfish_Test
-
Scratcher
500+ posts
Make a variable for just one clone
Just make the variable ‘for this sprite only’.
- logais
-
Scratcher
100+ posts
Make a variable for just one clone
Does making the variable ‘for this sprite only’ mean that each clone has a different variable?
- awesome_guy6856
-
Scratcher
100+ posts
Make a variable for just one clone
Does making the variable ‘for this sprite only’ mean that each clone has a different variable?Yes. Each clone has their own “version” of the variable. One clone could have its variable set to 10 whereas another clone only has it set to 9. They can freely change these variables.
A disadvantage to this, however, is that only that clone can access the variable. If you need other sprites/clones to access a clone's private variable you can use a list.
If you're interested in the list method I'm free to elaborate more on how to do it!

- logais
-
Scratcher
100+ posts
Make a variable for just one clone
Thanks for helping me, that makes everything so much easier! 

- freshBOT
-
New Scratcher
59 posts
Make a variable for just one clone
use the code block… for this sprite only
-Does this help?
-Do I need to elaborate?
-Does this help?
-Do I need to elaborate?
- logais
-
Scratcher
100+ posts
Make a variable for just one clone
Thanks everyone! I think I understand it now but I’ll comment on one of you guys profile pages if I get stuck! 

- AryanMaheshGarud
-
Scratcher
8 posts
Make a variable for just one clone
What to do in the scratch camp plz tell me
- Bloxmakesgames2019
-
Scratcher
100+ posts
Make a variable for just one clone
What to do in the scratch camp plz tell meHello this is not relevant to this topic please make a new post at this link https://scratch.mit.edu/discuss/4/
- Discussion Forums
- » Help with Scripts
-
» Make a variable for just one clone
