# Mc following mouse

**URL:** <https://forum.kirupa.com/t/mc-following-mouse/186485>\
**Category:** Uncategorized\
**Created:** [April 21, 2006, 4:29pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485 "2006-04-21T16:29:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willgoldstone7](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/willgoldstone7/32/2251_2.png) [@willgoldstone7](https://forum.kirupa.com/u/willgoldstone7)\
**Post date:** [April 21, 2006, 4:29pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485/1 "2006-04-21T16:29:17Z")

</div>

now i know how to attach an mc to the mouse position and how to offset an mc to the mouse position. however i would like to make an mc lag behind the cursor. im guessing this is done by creating a var that reads a previous position. can anyone help me put this into practice?  
cheers very much

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 21, 2006, 4:35pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485/2 "2006-04-21T16:35:55Z")

</div>

[AS]MC.onEnterFrame = function() {  
this.\_x += (\_root.\_xmouse-this.\_x)/10;  
this.\_y += (\_root.\_ymouse-this.\_y)/10;  
};[/AS]adjust the 10 to change easing.

---

<div class="post-metadata">

**Author:** ![mathew\_er](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mathew\_er](https://forum.kirupa.com/u/mathew_er)\
**Post date:** [April 21, 2006, 4:40pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485/3 "2006-04-21T16:40:20Z")

</div>

```auto
this.onEnterFrame = function() {
	mouse_mc._x += (_xmouse - mouse_mc._x) / 10;
	mouse_mc._y += (_ymouse - mouse_mc._y) / 10;
}

```

something of this type?

edit: oh, no… not again 😃

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 21, 2006, 4:53pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485/4 "2006-04-21T16:53:30Z")

</div>

:lol:^

---

<div class="post-metadata">

**Author:** ![willgoldstone7](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/willgoldstone7/32/2251_2.png) [@willgoldstone7](https://forum.kirupa.com/u/willgoldstone7)\
**Post date:** [April 21, 2006, 5:59pm UTC](https://forum.kirupa.com/t/mc-following-mouse/186485/5 "2006-04-21T17:59:59Z")

</div>

a bit too slow there i see,  
thanks very much
