Learning Goals 3 min
By the end of this lesson you will be able to:
- Use
showandhideto bring a sprite into a scene and take it out again. - Use
go to [front v] layerso sprites overlap in the right order. - Save the finished cartoon as an
.sb3file ready to show.
Warm-Up 7 min
Your cartoon has everything except a way for characters to arrive and leave. Every sprite is on stage from the first frame to the last, whether the scene needs them or not.
Quick-fire puzzle
Daniel hid a sprite at the end of one run. Next time he clicked the flag, it never came back. What had he forgotten?
when flag clicked
say [Goodbye!] for (2) seconds
hide
Reveal the answer
Hidden sprites stay hidden. The script never shows it again, so on the second run it was invisible from the start and its whole scene played out with nobody there.
This is the same trap as size sticking between runs, and it has the same fix: put the sprite into a known state at the top of the script.
New Concept — appearing, vanishing and stacking 15 min
In a play, actors walk on and off. In Scratch they cannot — the Stage has no wings. What they do instead is become invisible, which looks the same to the audience.
Blocks reference
| Block | Category | What it does |
|---|---|---|
hide | Looks | Makes a sprite invisible. It is still there, still running scripts. |
show | Looks | Makes it visible again. |
go to [front v] layer | Looks | Puts a sprite in front of the others where they overlap. |
Hidden is not gone
A hidden sprite keeps running its scripts, keeps moving, keeps its position and size. It simply is not drawn. That is genuinely useful — a sprite can get into place while invisible and then appear exactly where you want it.
Sprites are stacked, like paper
When two sprites overlap, one is drawn on top. Scratch keeps them in a stack, and go to [front v] layer moves a sprite to the top of it.
The state-resetting habit, one last time
This is the third time this lesson pattern has come up. Size sticks. Costume sticks. Visibility sticks. In every case the fix is a block at the top of the script that puts the sprite into a known state.
By now you should be reaching for that automatically. A flag script that opens with show, set size and switch costume is not fussiness — it is what makes a project play the same way twice.
Why it matters
Scenes need casts. A story where the same two characters stand in shot for four minutes is a very limited story. Being able to bring somebody in and take them out again is what lets a cartoon have acts.
Guided Build — an entrance and an exit 15 min
We give Abby a proper arrival: she is absent, appears in the right place, plays her part, and leaves.
Step 1 — Make Abby disappear
Select Abby and give her a script that hides her the moment the flag is clicked.
when flag clicked
hide
Step 2 — Bring her back after a pause
Add a wait and a show, so she arrives partway through the scene.
when flag clicked
hide
wait (3) seconds
show
say [Sorry I'm late!] for (2) seconds
Step 3 — Move her while she is invisible
Add a go-to between the hide and the show. Because she is invisible while it runs, the audience never sees her cross the room — she simply appears in the right spot.
when flag clicked
hide
go to x: (120) y: (0)
wait (3) seconds
show
say [Sorry I'm late!] for (2) seconds
Step 4 — Give her an exit
Add a hide at the end so she leaves when her part is done.
Step 5 — Break it with the stop sign
Run the scene and hit the red stop sign while Abby is still hidden, before her show block has run. She is now stuck invisible.
Click the flag again. Her script hides her, waits, and shows her — so she does come back eventually. But for those first three seconds the Stage looks wrong in a way it did not the first time, because she was already missing before the scene began.
Step 6 — Fix it with a full reset
Open the script with every piece of state this arc has taught you: visibility, size, and costume.
when flag clicked
hide
set size to (100) %
switch costume to [abby-a v]
go to x: (120) y: (0)
wait (3) seconds
show
say [Sorry I'm late!] for (2) seconds
Step 7 — Fix an overlap
Move Abby’s x to -100 so she lands on top of the cat. Whichever sprite is behind looks wrong. Add go to [front v] layer to whichever one should be nearer the camera.
What changed: your cartoon has a cast rather than a permanent line-up, and you have the full set of reset habits that make a project play the same way every time.
The full assembled stack (your reference)
when flag clicked
hide
set size to (100) %
go to x: (120) y: (0)
wait (3) seconds
show
say [Sorry I'm late!] for (2) seconds
hide
Try It Yourself — three small builds 12 min
Goal: Make a sprite blink in and out three times, ending visible.
when flag clicked
repeat (3)
hide
wait (0.3) seconds
show
wait (0.3) seconds
end
Think: the loop ends on show, so the sprite is always visible afterwards. Swap the two around and it ends invisible — which is a bug you will meet for real one day.
Goal: Make a sprite teleport across the room without the audience seeing it travel.
when flag clicked
go to x: (-150) y: (0)
show
wait (1) seconds
hide
go to x: (150) y: (0)
wait (0.5) seconds
show
Think: the go-to happens between the hide and the show, so the travel is invisible. Move it before the hide and the audience sees the jump.
Mini-mission: a three-character scene. Build a scene where three sprites take turns being on stage, and never more than two are visible at once.
It works if: one flag click plays the whole scene, all three characters appear at some point, never more than two are visible together, and everyone is in the right state at the start of a second run. Keep each stack within 8 blocks.
Think: each sprite needs its own script and its own timings, and no sprite can see the others. What do you have to write down before you start building?
Mini-Challenge — the vanishing act 5 min
“Now you see me”
Build a magic trick: a sprite vanishes in one place and instantly reappears somewhere else, with a reaction from a watching character.
It works if:
- One flag click plays the whole trick.
- The sprite genuinely disappears and comes back in a different place.
- The audience never sees it travel between the two spots.
- Another character reacts visibly, using a block from any earlier lesson.
Reveal one valid solution (teacher)
when flag clicked
show
go to x: (-160) y: (0)
wait (2) seconds
hide
go to x: (150) y: (0)
wait (0.5) seconds
show
The half-second gap between hide and show is what sells it — vanish and reappear in the same frame and the eye reads it as a glitch rather than a trick.
Recap 2 min
Hide makes a sprite invisible without removing it — it keeps running, keeps its position, and can be moved while nobody is looking. Show brings it back. Where sprites overlap they are stacked, and the layer block decides who is in front. And for the third time this arc: state sticks between runs, so a flag script that does not reset visibility, size and costume will play differently every time.
- hide / show
- Looks blocks that make a sprite invisible or visible. Hidden sprites still run scripts.
- Layer
- The stacking order of sprites where they overlap.
- go to front layer
- Moves a sprite to the top of the stack so it is drawn in front.
- State reset
- The blocks at the top of a flag script that put a sprite into a known condition.
Homework 1 min
The reset checklist. Go through every sprite in your cartoon and give each one a complete opening state.
- For each sprite, list what its flag script should set: visible or hidden, size, costume, position.
- Add whatever is missing to the top of each script.
- Play the cartoon three times and confirm all three runs are identical.
- Screenshot one sprite’s completed opening blocks.
when flag clicked
hide
set size to (100) %
switch costume to [costume1 v]
go to x: (0) y: (0)
Bring back next class:
- Your screenshot and your reset checklist.
- Your answer to: “Which piece of state caused the most trouble in your cartoon, and why did you not notice it at first?”
Heads up for next class: SCR-L01-30 starts a new arc. Instead of changing the characters, you start changing the world behind them.