Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Clones move offscreen
- S_Crab
-
Scratcher
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
-
Scratcher
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
-
Scratcher
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
move () stepswould be as follows:
define move (x) steps
move (x) steps (costume #)
define move (x) steps (c)
switch costume to [bigCrosshair v]
move (x) steps
switch costume to (c)
- S_Crab
-
Scratcher
10 posts
Clones move offscreen
when I start as a clone
show
forever
if <(costume #) = [1]> then
go to x: ((mouse x) / (10)) y: (0)
end
end
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
move (x) stepsto achieve the effect. How can I implement this anyway?
- legendary34678
-
Scratcher
1000+ posts
Clones move offscreen
Just switch the costume before the movement and after the movement like so:
switch costume to [super large costume v]
go to x: () y: ()
switch costume to [parallax costume v]
- DexFire
-
Scratcher
100+ posts
Clones move offscreen
Using the costume switching method (size changing also works too)when I start as a clone
show
forever
if <(costume #) = [1]> then
go to x: ((mouse x) / (10)) y: (0)
end
end
This is an example code for how I get my clones to move according to my mouse position. I noticed all these other solutions usemove (x) stepsto achieve the effect. How can I implement this anyway?
define go to x: (x) y: (y)
go to x: (x) y: (y) (costume #)
define go to x: (x) y: (x) (c)
switch costume to [bigCrosshair v]
go to x: (x) y: (y)
switch costume to (c)
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
-
Scratcher
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
-
Scratcher
100+ 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 atYes, a link would be helpful. Both methods should work given the size / costume dimensions are large enough for the goal you have in mind.
- ThinkingPlanely
-
Scratcher
100+ 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 atThis method should work with bigger costumes. You'll need a blank costume in the sprite for this to work.

- coIIide
-
Scratcher
100+ posts
Clones move offscreen
You could do
define set x: (x) y:(y)
s (x) (y) (size) (costume [name v] :: looks) :: custom
define s (x) (y) (size :: custom) (costume)
switch costume to [Fencing Bypass v] // A blank costume achieved by putting something in sve then deleting
set size to (join [Infinity] ()) % // (btw sve is scratch vector editor)
go to x: (x) y: (y)
switch costume to (costume)
set size to (size :: custom)
- PhoenixEntropy
-
Scratcher
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.how did you get that block skin? it looks really cool
- ThinkingPlanely
-
Scratcher
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.Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.how did you get that block skin? it looks really cool
- PhoenixEntropy
-
Scratcher
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.Yes! One way is to increase the size of the clone, move it, then decrease it back to the original size.how did you get that block skin? it looks really cool
- MAX_VR_VR_VR
-
Scratcher
1 post
Clones move offscreen
i need help making one of my clones spawn at a random time and make it walk across the screen
- kemlevor
-
Scratcher
63 posts
Clones move offscreen
@Max_vr_vr_vr :
the clone will start at a random position of the screen (could use go to random position bloc) and glide during 1s to an other random position (for smoothness) forever
when I start as a clone
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
forever
glide (1) secs to x: (pick random (-240) to (240)) y: (pick random (-240) to (240))
end
the clone will start at a random position of the screen (could use go to random position bloc) and glide during 1s to an other random position (for smoothness) forever
Last edited by kemlevor (Nov. 19, 2025 17:30:49)
- Discussion Forums
- » Help with Scripts
-
» Clones move offscreen