set y to (0) — Scratch Block Guide
Places the sprite at an exact vertical coordinate while preserving its x coordinate.
What this block does
Places the sprite at an exact vertical coordinate while preserving its x coordinate.
Reset falling objects back to the top of the screen (y = 180) cleanly.
- Category: Motion Blocks
- Key tip: Combine with "set x to (pick random -200 to 200)" for varied falling rain or stars.
Working Scratch example
Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.
- When green flag clicked
- Set y to 170
- Forever
- Change y by -5
- If <y position (-170) then
- Set y to 170
Try it: The sprite falls repeatedly from the top edge to the bottom edge.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "set y to (0)" in Scratch?
Reset falling objects back to the top of the screen (y = 180) cleanly. Combine with "set x to (pick random -200 to 200)" for varied falling rain or stars.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.