Stop a Scratch Sprite at a Specific Y-Level: Conditional Loop Script
Use a conditional loop that checks the sprite's y-position and stops all scripts when the target is reached.
Example Script
when green flag clicked
forever
move (10) steps
if ≥ (180) then
stop [all v] scripts [in sprite v]
end
end
Key Points
- Replace 180 with your desired Y-level (stage bottom = -180, top = 180).
- If multiple movement scripts exist, add the same if/stop block to each.
- For horizontal movement, check x position instead.
- Use a variable (e.g., targetY) for adjustable levels.
This halts the sprite instantly upon reaching the coordinate.