# MovieClip Facing Mouse Issue

**URL:** <https://forum.kirupa.com/t/movieclip-facing-mouse-issue/296673>\
**Category:** flash\
**Created:** [September 18, 2009, 1:28am UTC](https://forum.kirupa.com/t/movieclip-facing-mouse-issue/296673 "2009-09-18T01:28:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foodstuff](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Foodstuff](https://forum.kirupa.com/u/Foodstuff)\
**Post date:** [September 18, 2009, 1:28am UTC](https://forum.kirupa.com/t/movieclip-facing-mouse-issue/296673/1 "2009-09-18T01:28:26Z")

</div>

I’m making a top down shooter and I’m encountering some interesting code lag with the function I’m using to make the player face the mouse.

```auto
//The function is called through a ENTER_FRAME listener.
//mX & mY are the current position of the mouse.
public function facePoint(mX, mY){
            if(this.visible){
                this.rotation = (-Math.atan2((this.x - mX),(this.y - mY))) * 180 / Math.PI;
            }
        }

```

If I hold down two movement keys and then spin the mouse around the character really fast, it builds up some kind of buffer that sends the character out of control for a few seconds, even after you’ve released the keys.

EDIT: Just discovered that reducing the quality to low removes the issue entirely… so its a graphics problem. Any wisdom on how to avoid this?
