I have problems with this, I'm not sure if I'm using the proper script. here it is. onClipEvent (enterFrame) { dy = _ymouse-this._y; dx = _xmouse-this._x; radius = Math.sqrt(dy*dy + dx*dx); degrees = Math.atan2(dy,dx); this._rotation = degrees*Math.PI/180; }
It might be a problem with the registration point of your movie clip. Make sure the registration point (the little + sign) of your MC is where you want the movieClip to rotate, and not in the center.
and it worked for me, so make sure your registration point is located in the right position. All you have to do is go inside the movieClip and move the graphic so that the desired pivot point is located in the location you wish to rotate.
Try this code: onClipEvent (enterFrame) { _rotation = ((Math.atan2(_root._ymouse-_y,_root._xmouse-_x)/(Math.PI/180))+90 } Make sure your gun movie clip is facing upwards.