# Pick up problem

**URL:** <https://forum.kirupa.com/t/pick-up-problem/203186>\
**Category:** programming\
**Created:** [October 8, 2006, 10:16pm UTC](https://forum.kirupa.com/t/pick-up-problem/203186 "2006-10-08T22:16:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose3760](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jose3760/32/2887_2.png) [@jose3760](https://forum.kirupa.com/u/jose3760)\
**Post date:** [October 8, 2006, 10:16pm UTC](https://forum.kirupa.com/t/pick-up-problem/203186/1 "2006-10-08T22:16:49Z")

</div>

alright, I have my character with the simple walking and jumping commands and he has a rotating hand ( the code for the hand is:

max=30  
onEnterFrame = function () {  
//angale  
divX = \_root.\_xmouse-\_root.man.\_x;  
divY =\_root.\_ymouse- \_root.man.\_y;  
theta = Math.atan2(divX, divY)-(Math.PI/2);  
//dis  
defx = \_root.man.\_x - \_root.\_xmouse;  
defy = \_root.man.\_y - \_root.\_ymouse;  
dis = Math.sqrt((defx_defx)+(defy_defy));  
//  
if (dis\<max) {  
\_root.hand.\_x = \_root.man.\_x+Math.cos(-theta)\*dis;  
\_root.hand.\_y = \_root.man.\_y+Math.sin(-theta)\*dis;  
} else {  
\_root.hand.\_x = \_root.man.\_x+Math.cos(-theta)\*max;  
\_root.hand.\_y = \_root.man.\_y+Math.sin(-theta)\*max;  
}  
};

how would I make it so that when I click on a axe or gun or something on the ground, my character holds it in his hand, where I can then shoot it or hit with it?

-thanks, Joesph
