# distance to (mouse-pointer / Sprite) — Scratch Block Guide > Returns the straight-line pixel distance between this sprite’s center and the target. How to use the "distance to (mouse-pointer / Sprite)" block in Scratch 3.0 (Sensing Blocks): clear explanation, working block example, and debugging tips. ## What this block does Returns the straight-line pixel distance between this sprite’s center and the target. Trigger enemy aggro when within 120 pixels or calculate circular hit detection. - Category: Sensing Blocks - Key tip: Much faster than pixel-perfect collision for circular objects like planets or explosions. ## 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 distance to (mouse-pointer / Sprite)** - When green flag clicked - Forever - If <(distance to (Player)) < (120)> then - Point towards (Player) - Move (3) steps Try it: Enemy wakes up and chases the player when they get close. ## Related block guides Explore other blocks in the same category or return to the full English Block Dictionary. - [Back to Sensing Blocks](/en/dictionary/sensing/): See the overview and patterns for Sensing Blocks. - [Scratch Block Dictionary (All Categories)](/en/dictionary/): Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Updated: 2026-11-24 Author: [Takamasa Suzuki](https://scratch.gmnavi.jp/about/author/) Japanese Edition: https://scratch.gmnavi.jp/dictionary/sensing/distance-to/ [Scratch Daizen (English)](https://scratch.gmnavi.jp/en/)