# Help With X & Y for Bullet

**URL:** https://forum.kirupa.com/t/help-with-x-y-for-bullet/332305
**Category:** flash
**Created:** [April 11, 2014, 3:32am UTC](https://forum.kirupa.com/t/help-with-x-y-for-bullet/332305 "2014-04-11T03:32:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Beacle](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@Beacle](https://forum.kirupa.com/u/Beacle)
#### Post date: [April 11, 2014, 3:32am UTC](https://forum.kirupa.com/t/help-with-x-y-for-bullet/332305/1 "2014-04-11T03:32:52Z")

</div>

Hello There, Im in urgent help with getting a bullet to spawn where the gun is…  
The gun is inside the char…

(ill skip all my other code…i just want to explain my problem)

```auto
function onEnterFrame(){
if(Key.isDown(Key.SPACE)){
a = attachMovie("bullet", "bullet" + fired, _root.getNextHighestDepth());
a._x = _root.char.gun._x;
a._y = _root.char.gun._y
fired += 1;
}

```

But in this code… the bullet doesnt get attached to the guns location… but if i set it to attach to the char… it will work. I need to know how to get this to work asap. Thank yo uso much.
