Child node does not move to parent node position

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.

In the inspector, the gun successfully becomes a child of the camera

However, you can walk anywhere and the pistol doesn’t move. Using setParent() also has the same result for me.

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

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

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

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

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

1 Like

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 :smile:

Thanks for checking in