# Constraining movement by radius

**URL:** https://forum.kirupa.com/t/constraining-movement-by-radius/80841
**Category:** open source
**Created:** [February 25, 2005, 4:23am UTC](https://forum.kirupa.com/t/constraining-movement-by-radius/80841 "2005-02-25T04:23:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flytie52000](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@flytie52000](https://forum.kirupa.com/u/flytie52000)
#### Post date: [February 25, 2005, 4:23am UTC](https://forum.kirupa.com/t/constraining-movement-by-radius/80841/1 "2005-02-25T04:23:52Z")

</div>

This doesn’t look pretty or accomplish anything groundbreaking, but may come in handy for someone looking to constrain the movement of something like the crosshairs in a game.

I am working on a game (play my finished games [HERE](http://www.eddiesolutions.com)) and wanted to constrain the movement of the mouse controlled crosshair to a certain radius around the player. Since it gave me difficulties I figured I’d post a simple demonstration of my solution.
