Im making a 2D game with box2D physics, and i want to implement a parent-child system between the objects. The child's position will be relative to it parent. For example, father object position is (10, 0), the relative child's position is (0, 1) and the result child's position is (10, 1).
I was thinking about how to implement something like that, and I came to the conclusion that adding to each component of the child's position vector the parent's current position minus parent's previous frame position, this effect was achieved.
That worked fine in a normal game, but with box2d physics, there is some "delay" and children position seems to update slower than the father.
There is a proper way to achieve this effect more accurately?