Discuss Scratch

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’.
EPIC_NACHO789
Scratcher
7 posts

Make a variable for just one clone

what is the variable for?
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

logais wrote:

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?
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

AryanMaheshGarud wrote:

What to do in the scratch camp plz tell me
Hello this is not relevant to this topic please make a new post at this link https://scratch.mit.edu/discuss/4/
jupiter7777
Scratcher
1 post

Make a variable for just one clone

poggers
cwkevan63397
Scratcher
1 post

Make a variable for just one clone

it does not work for me

Powered by DjangoBB