# Shoot towards coursor..?

**URL:** https://forum.kirupa.com/t/shoot-towards-coursor/128603
**Category:** Uncategorized
**Created:** [November 14, 2004, 4:47pm UTC](https://forum.kirupa.com/t/shoot-towards-coursor/128603 "2004-11-14T16:47:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![danulf](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/danulf/32/555_2.png) [@danulf](https://forum.kirupa.com/u/danulf)
#### Post date: [November 14, 2004, 4:47pm UTC](https://forum.kirupa.com/t/shoot-towards-coursor/128603/1 "2004-11-14T16:47:48Z")

</div>

Or whatever you want to call it…

Anyhow, I have a man, and his arm follows the mouse (points to it, mouse detection).  
But how do I do so that he can shoot where the mouse clicks…?

I hope you understand my question, I can’t quite explain it! 😃

This is the code for the arm:

```php

onClipEvent (mouseMove) {
    x = this._xmouse;
    y = this._ymouse*-1;
    angle = Math.atan(y/x)/(Math.PI/180);
    if (x<0) {
        angle += 180;
    }
    if (x>=0 && y<0) {
        angle += 360;
    }
    updateAfterEvent();
	_root.arm._rotation=angle*-1;
}

```
