# Sprite Will Not Move When Pressing Keys > Fix the #1 beginner bug: missing "forever" loop around "if " or missing hat block. Sprite Will Not Move When Pressing Keys — Fix the #1 beginner bug: missing "forever" loop around "if " or missing hat block. ## Core approach An "if " snapped directly under "When green flag clicked" checks only for 1 millisecond and stops. Wrap it inside a "forever" loop! - Confirm a hat block ("When green flag clicked") sits at the top. - Wrap continuous key checks inside "forever". - Check that you did not accidentally put code on the Stage or a different sprite. ## Pro tip & next steps A glowing yellow outline around a script shows it is actively running. - [All Troubleshooting Guides](/en/troubles/): Browse more English guides in this section. - [Scratch Block Dictionary](/en/dictionary/): Look up any Scratch 3.0 block with examples. Updated: 2026-11-23 Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/) Japanese Edition: https://scratch.gmnavi.jp/troubles/not-moving/ [Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)