A bug in the interaction of children and parents with physical bodies

Hello everyone I think I found a bug (or is it a bug in my code). In this example, the sphere is the parent of the box and all objects have physical bodies. The sphere can be dragged. The problem is that the box moves perfectly behind the sphere if it has a static type, but if the sphere falls, then the box remains in place. (Clearly if you lift the sphere and let go) For the game I’m developing, I need the ability for the child to move behind the parent, even if the parent has a dynamic type. Do you have any ideas how to achieve this? Thank you all!

cc @Cedric

Sorry, I don’t understand this sentence. Do you want the child (box) to move just like it’s not parented?
Why do you need to parent both objects actually?

No, I meant that the child element (box) moves along with the parent (sphere) if the parent has a static motion type. If the parent has a dynamic type of motion, then the child element stands still, despite the fact that the parent is moving. This can be observed on the playground if you lift the sphere and then release it. The sphere will fall, and the cube will remain in its original place. I wanted to find out if it was possible for the cube to follow the sphere regardless of the type of motion. Sorry I didn’t make myself clear enough, English is not my native language)

In that case, the box can follow the sphere only with Static and Kinematic. In dynamic mode, the body become independant. So, it’s not a bug, what you see is the intended behavior.
What is your use case?


In this example, I just assign the parent of the dragged end of the wire. It worked well if you “attach” it to objects without physical bodies, but in this case there seems to be no way out except using physiсs constraints?

exactly, at this physics level, to attach objects, you need to use constraints.

Great, thanks for helping me figure it out! :partying_face:

1 Like