Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clones move offscreen
- S_Crab
-
10 posts
Clones move offscreen
I'm working on a parallax that uses clones to work, and I'm trying to make it so that they can move further offscreen than usual. Is there an easy way to do this?
- ThinkingPlanely
-
100+ posts
Clones move offscreen
Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.


- DexFire
-
100+ posts
Clones move offscreen
Scratch has a “fencing” around the edge of the screen that prevents any sprite from moving beyond the edge of the screen to the point it's bounding box is not on the screen. The bounding box is the rectangular perimeter enclosing everything in the costume, you can check this by going to the costume and doing CTRL/Command + A to select all.
There are several ways to circumvent this. The easiest would be using 3rd party software to eliminate the fencing limitation, although this doesn't work for other users if they don't have a similar feature.
Another option is making a sprite larger than necessary. This is especially common with pen games where drawing sprites don't need to be seen on screen. Thus, they're usually just giant plus signs that span the length of the entire drawing canvas, allowing these sprites to reach outside the edge of the screen. This can be applied to other sprites in vector by making a giant rectangle around the sprite that is completely transparent with no outline (a similar option can be achieved in bitmap with 1% opacity dots on each corner of the canvas, although this does mess with collision detection and “is touching sprite”). This does have the side effect of also fixing the weird 3.0 issue where the edges of sprites get chopped off (I have no clue why this even occurs, must be a WebGL rendering issue or something?), hence why I box a lot of my sprites with transparent rectangles. The only issue with this is these sprites will have a lower quality as bigger sprites get their costumes downscaled in rendering (you will notice this when using sprites with large sizes like 600%).
Thus, the best way would be to change the costume of the sprite to something like those really large crosshair sprites used in pen projects, moving the sprite, then switching the costume back.
An example of this with
There are several ways to circumvent this. The easiest would be using 3rd party software to eliminate the fencing limitation, although this doesn't work for other users if they don't have a similar feature.
Another option is making a sprite larger than necessary. This is especially common with pen games where drawing sprites don't need to be seen on screen. Thus, they're usually just giant plus signs that span the length of the entire drawing canvas, allowing these sprites to reach outside the edge of the screen. This can be applied to other sprites in vector by making a giant rectangle around the sprite that is completely transparent with no outline (a similar option can be achieved in bitmap with 1% opacity dots on each corner of the canvas, although this does mess with collision detection and “is touching sprite”). This does have the side effect of also fixing the weird 3.0 issue where the edges of sprites get chopped off (I have no clue why this even occurs, must be a WebGL rendering issue or something?), hence why I box a lot of my sprites with transparent rectangles. The only issue with this is these sprites will have a lower quality as bigger sprites get their costumes downscaled in rendering (you will notice this when using sprites with large sizes like 600%).
Thus, the best way would be to change the costume of the sprite to something like those really large crosshair sprites used in pen projects, moving the sprite, then switching the costume back.
An example of this with
would be as follows:
- S_Crab
-
10 posts
Clones move offscreen
This is an example code for how I get my clones to move according to my mouse position. I noticed all these other solutions use
to achieve the effect. How can I implement this anyway?
- legendary34678
-
1000+ posts
Clones move offscreen
Just switch the costume before the movement and after the movement like so:
- DexFire
-
100+ posts
Clones move offscreen
Using the costume switching method (size changing also works too)
This is an example code for how I get my clones to move according to my mouse position. I noticed all these other solutions useto achieve the effect. How can I implement this anyway?
The only important thing is switching from the actual costume to the large costume then back to the actual costume. The move (x) steps was just an example. For the size changing strategy, just switch from the actual size to the large size then back to the actual size.
- S_Crab
-
10 posts
Clones move offscreen
I have tried implementing both the costume and size strategies, but the clones will still stop at a short border offscreen, just as before. A couple of my costumes are already a little bit offscreen in size, would that affect it at all? I can post the link to the project if you'd like to look at it to see where I am at
- DexFire
-
100+ posts
Clones move offscreen
Yes, a link would be helpful. Both methods should work given the size / costume dimensions are large enough for the goal you have in mind. I have tried implementing both the costume and size strategies, but the clones will still stop at a short border offscreen, just as before. A couple of my costumes are already a little bit offscreen in size, would that affect it at all? I can post the link to the project if you'd like to look at it to see where I am at
- ThinkingPlanely
-
100+ posts
Clones move offscreen
This method should work with bigger costumes. You'll need a blank costume in the sprite for this to work. I have tried implementing both the costume and size strategies, but the clones will still stop at a short border offscreen, just as before. A couple of my costumes are already a little bit offscreen in size, would that affect it at all? I can post the link to the project if you'd like to look at it to see where I am at

- PhoenixEntropy
-
100+ posts
Clones move offscreen
how did you get that block skin? it looks really cool Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.
- ThinkingPlanely
-
100+ posts
Clones move offscreen
I use the “Customizable block shape” addon in TurboWarp with the corner size at 200% and notch height at 0. It's what I normally use on TurboWarp.how did you get that block skin? it looks really cool Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.
- PhoenixEntropy
-
100+ posts
Clones move offscreen
ohh okay thanksI use the “Customizable block shape” addon in TurboWarp with the corner size at 200% and notch height at 0. It's what I normally use on TurboWarp.how did you get that block skin? it looks really cool Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.
- Discussion Forums
- » Help with Scripts
-
» Clones move offscreen