Child node don't follow its parent in a physics world

First of all, I made the same question on StackOverflow too, I hope this isn’t a problem. I know this question is not new, but all other topic are realy old and I can’t figure out how to fix it.

In my scene I have a node with a RigidBody component. This node have a child with the same RigidBody component. If I move my parent node, the child stay in the original position (if is static, or falls if it is dynamic). Whitout the physics all work as I expected.

There is a solution or a fix ? or is the logic wrong?

Thanks

from the underlying physics engine perspective, a rigidbody as a child of another rigidbody doesn’t make sense :slight_smile: (despite the fact that CC lets you do this). if you want a rigidbody to follow another rigidbody as if it were a child, use a joint (weld joint, for instance).

I suspected it was the wrong logic. I will use the joint. Thank you

usually, when i work with a physics engine, i have this setup: have a “root physics node” (be it in cocos or flash or openfl) and every physics body (rigidbody) that belongs to the actual simulation is a direct child of the root, in a flat hierarchy. this way i’m mostly sure that i don’t run into weird bugs related to node transformations and, if debug needs to be done, it should be easier to inspect the hierarchy, because, well, it’s flat :smiley: