# Giving 'weight' to a movie clip

**URL:** <https://forum.kirupa.com/t/giving-weight-to-a-movie-clip/251990>\
**Category:** flash\
**Created:** [February 14, 2008, 4:37pm UTC](https://forum.kirupa.com/t/giving-weight-to-a-movie-clip/251990 "2008-02-14T16:37:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theMonitor](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@theMonitor](https://forum.kirupa.com/u/theMonitor)\
**Post date:** [February 14, 2008, 4:37pm UTC](https://forum.kirupa.com/t/giving-weight-to-a-movie-clip/251990/1 "2008-02-14T16:37:41Z")

</div>

A tricky one to explain, this, as I can’t post example AS or SWFs, but here’s what I’m trying to do…

I’m creating a game which features a top-down view of a character carrying a sack over their shoulder. The character moves by following the cursor and is always rotated to face it. I want to give the sack (which is a movie clip nested in the character) some ‘weight’ by having it rotate slightly more slowly then the character - i.e. when the character turns, the sack takes a moment to catch up. At the moment its orientation relative to the character doesn’t change and the effect is a bit stiff.

The code I’m using to rotate the character is along the lines of

function pointAtMouse(target) {  
var dx = \_xmouse - target.\_x;  
var dy = \_ymouse - target.\_y;  
return Math.atan2(dy,dx) \* 180/Math.PI;  
}

Can anyone suggest how I can make the my sack ‘swing’, if you’ll pardon the expression?
