# Constraining/Avoiding Organic Shapes

**URL:** <https://forum.kirupa.com/t/constraining-avoiding-organic-shapes/220603>\
**Category:** flash\
**Created:** [March 27, 2007, 5:51pm UTC](https://forum.kirupa.com/t/constraining-avoiding-organic-shapes/220603 "2007-03-27T17:51:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lauralynsilva](https://avatars.discourse-cdn.com/v4/letter/l/7feea3/32.png) [@lauralynsilva](https://forum.kirupa.com/u/lauralynsilva)\
**Post date:** [March 27, 2007, 5:51pm UTC](https://forum.kirupa.com/t/constraining-avoiding-organic-shapes/220603/1 "2007-03-27T17:51:00Z")

</div>

Hello all,

I’m currently working on a 2D (top view) racing game and I’m currently stuck trying to figure out how to keep the motorbike inside the racing track.

I’ve read about hittest but I failed when I tried coding it into the game as I’m not too familiar with it so I’ve resorted to a constrain/avoid script. I’ve tried but it won’t work because the shape of my track is pretty organic. Is there a way for me to constrain the motorbike to an organic shape???

Also, the script that I found, is applied to a mouse movement and not a movieclip like i want it to and I’m trying to figure out how to apply it to a movieclip. A file of the script I found is attached.

**EDIT**  
For those who’ve viewed this, I found a solution at [actionscript.org](http://www.actionscript.org/forums/showthread.php3?t=132160)
