Very optimized "follow mouse"-thing

I just made a code that makes an mc following the mouse! :slight_smile:
Put this in the mc’s action and see the result! :slight_smile:
And put the framerate to 30-120 or something for smooth movements. :smiley:

onClipEvent (load) {
 var wait_time = 50, a = new Array();
}
onClipEvent (enterFrame) {
 a[a.length] = [_root._xmouse, _root._ymouse];
 _x=a[a.length-wait_time][0], _y=a[a.length-wait_time][1];
}