# Follow mouse only at certain angle?

**URL:** <https://forum.kirupa.com/t/follow-mouse-only-at-certain-angle/321877>\
**Category:** flash\
**Created:** [May 4, 2011, 7:30am UTC](https://forum.kirupa.com/t/follow-mouse-only-at-certain-angle/321877 "2011-05-04T07:30:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John4213](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@John4213](https://forum.kirupa.com/u/John4213)\
**Post date:** [May 4, 2011, 7:30am UTC](https://forum.kirupa.com/t/follow-mouse-only-at-certain-angle/321877/1 "2011-05-04T07:30:39Z")

</div>

Hey, I can’t work out how to do this, but this is what I have so far…

onClipEvent (enterFrame) {  
radians = Math.atan2(\_root.\_ymouse-this.\_y, \_root.\_xmouse-this.\_x);  
degrees = (radians/Math.PI)\*180;  
\_rotation = degrees;  
}

How would I make it so that it can only point between 0 and 90 degrees? Thanks.
