# Child node does not move to parent node position

**URL:** <https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840>\
**Category:** Questions\
**Created:** [February 1, 2023, 7:23pm UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840 "2023-02-01T19:23:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tri](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tri/32/21447_2.png) [@tri](https://forum.babylonjs.com/u/tri)\
**Post date:** [February 1, 2023, 7:23pm UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840/1 "2023-02-01T19:23:42Z")

</div>

I’m trying to get my gun model (pistol) to always follow the camera’s position.  
This line of code sets the parent of the gun mesh as the camera.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/9/d/9d8afea386904ded0e8b4e517c26c402aaf73ddd.png)

In the inspector, the gun successfully becomes a child of the camera  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/6/668ba256d982716bf07fe51ca3294ddac58a9e35.png)

However, you can walk anywhere and the pistol doesn’t move. Using setParent() also has the same result for me.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/4/640b493508294fcaa2d7d4a0831c1202ab25b569.jpeg)

If i replace the gun with a simple box, it works just fine…

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/7/27894c852cef4073bc26601e90add31c41893c44.png)

What is it that I’m doing wrong, that the child node wont follow the camera location, but a normal box will?

Thank you in advance

---

<div class="post-metadata">

**Author:** ![tri](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tri/32/21447_2.png) [@tri](https://forum.babylonjs.com/u/tri)\
**Post date:** [February 1, 2023, 7:59pm UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840/3 "2023-02-01T19:59:15Z")

</div>

Hi, thanks for your help, but useParent() has the same result for me

---

<div class="post-metadata">

**Author:** ![tri](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tri/32/21447_2.png) [@tri](https://forum.babylonjs.com/u/tri)\
**Post date:** [February 1, 2023, 9:03pm UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840/5 "2023-02-01T21:03:19Z")

</div>

No worries, thanks for your help. I’ll look more into this problem tomorrow ✌

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [May 3, 2023, 4:34pm UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840/6 "2023-05-03T16:34:54Z")

</div>

Hello! Just checking in, are you still having this problem?

---

<div class="post-metadata">

**Author:** ![tri](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tri/32/21447_2.png) [@tri](https://forum.babylonjs.com/u/tri)\
**Post date:** [May 4, 2023, 11:19am UTC](https://forum.babylonjs.com/t/child-node-does-not-move-to-parent-node-position/37840/7 "2023-05-04T11:19:33Z")

</div>

Oh, haha! I forgot about this thread!  
I don’t remember fixing it for models, but it seemed to work for a babylonjs box instead, so I just used that instead to represent the gun 😄

Thanks for checking in
