NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

set y to (0) — Scratch Block Guide

📌 What you will learn

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.

Example using set y to (0)
  1. When green flag clicked
  2. Set y to 170
  3. Forever
  4. Change y by -5
  5. If <y position (-170) then
  6. 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.

Back to Motion Blocks See the overview and patterns for Motion Blocks. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

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.