# Problem in nested parent-entity relationship in ecs

In the given flow, the character is the parent entity, gun is child of character and bullet is child of gun. I've got a component called NodeComponent which has the storage of child entities and a NodeSystem that iterate the children then update its position relative to its parent. The problem is when the iteration reach to the bullet, it takes some time to update the bullet position. So when I move the parent the bullet is noticeable. How do I handle the parent-child relationship transformation without losing or slowing down the update from top to bottom?

Character >>
Gun >>
Bullet

• Is the bullet inside the gun? – Vaillancourt Jul 26 '16 at 17:51
• yes, it was. .. – ronscript Jul 26 '16 at 18:06
• Once the gun shoots the bullet, there is no longer a parent-child relationship. The gun should have all the information to spawn the bullet, but the bullet should be a child of the main node of your environment, not be a child of the gun. – Vaillancourt Jul 26 '16 at 18:08
• hmmm I can't understand why the bullet should be the child of main node? – ronscript Jul 26 '16 at 18:16
• Then I don't really understand the question. In real life, once you shoot a bullet with a gun, the bullet is no longer linked to the gun, in any way. It's free. It's living its own life! It's as free as the player. Once I hit the trigger, the bullet is gone and even though I move gun, there is no way I can influence the trajectory. – Vaillancourt Jul 26 '16 at 18:21

The relationship between the Gun and the Bullet is purely 'spawner/spawned'. It's not parent-child.