parent/child translate problem

Hello,

I’m working on a simple FPS game.
I have a character (with arms, of course). Its right arm has a child : an empty object which instantiate some weapons. One of the weapons has a child : a projectile instantiated when the weapon is selected.
When i shoot i break the link by unparenting the projectile from the weapon, and i instantiate a new one, again child of the weapon.

With this weapon in the hand, while i’m rotating i can see the projectile follow the weapon, but when i move the character, front, back or on one side, the projectile does not follow, stays where it is, but still follows the rotating movements ! (so it still is a child of the weapon, no ?)

I don’t understand how a problem can appear on the projectile and not on the weapon because my code is the same for both …

I noticed that if i don’t have any rigidbody attached to my projectile, there is no problem, it follows the weapon, but i can’t launch it :

projectile.rigidbody.AddForce(projectile.transform.forward * speed);

So the rigidbody has to be the problem, but I don’t understand why …

EDIT :
For those who have the problem, I solved it with an instantiation of the rigidbody only at the moment when the projectile must move. No more translation problem before :slight_smile: