Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I get the X & Y position of clones?
- PBfriedpanSTUDIOS
-
60 posts
How do I get the X & Y position of clones?
How do I get the X & Y position of clones?
- archgavriel
-
51 posts
How do I get the X & Y position of clones?
cloneid is for this sprite only
- PBfriedpanSTUDIOS
-
60 posts
How do I get the X & Y position of clones?
I just remembered that i have to keep saving the position of the clone every single tick until the clone gets removed, so that doesnt work.cloneid is for this sprite only
- deck26
-
1000+ posts
How do I get the X & Y position of clones?
So put a loop around the replace items blocks.I just remembered that i have to keep saving the position of the clone every single tick until the clone gets removed, so that doesnt work.cloneid is for this sprite only
- PBfriedpanSTUDIOS
-
60 posts
How do I get the X & Y position of clones?
Then the clone id changes all the time and the positions of the clones gets replaced with another clone’s X and Y positionsSo put a loop around the replace items blocks.I just remembered that i have to keep saving the position of the clone every single tick until the clone gets removed, so that doesnt work.cloneid is for this sprite only
- deck26
-
1000+ posts
How do I get the X & Y position of clones?
No, the cloneid is presumably a local variable so each clone has its own value and the loop is only around the code that updates the list.Then the clone id changes all the time and the positions of the clones gets replaced with another clone’s X and Y positionsSo put a loop around the replace items blocks.I just remembered that i have to keep saving the position of the clone every single tick until the clone gets removed, so that doesnt work.cloneid is for this sprite only
But in the code above cloneid should start with value 2 or the first clone is trying to access items -1 and 0 in the list.
Last edited by deck26 (March 15, 2024 09:15:31)
- Discussion Forums
- » Help with Scripts
-
» How do I get the X & Y position of clones?