Child Does Not Move With Parent

I have a transform, with a rigidbody. This transform acts as a parent to another object. When I move this rigidbody, the child does not move with it. Any ideas?

Post the script and, if possible, a screenshot of the inspector view of the child object.

It’s weird. I had a parent with a rigidbody, collider as trigger, I had a child collider, in that child I had my sprites and various other bits. Originally, when the parent moved, via rigidbody.velocity() the child and its children did not. I, however, just removed the child, but placed the child’s children in the parent instead, more of a direct link and it worked.

My only suggestion is perhaps, the abnormality was caused by the fact the child was a character controller. Other than that I am clueless. But I did get it working.
Thanks

It’s hard to tell from your description, but I’m thinking you may have had a rigidbody attached to one of the child objects.

1 Like

Perhaps. Regardless it is working. I it a known fact that if you have a rigidbody inside a rigidbody that it will not move with the parent? Seems odd if true.

Regardless, it is working on my half.
:stuck_out_tongue:

1 Like

A Rigidbody is a component that handles physics interactions - if child rigidbodies didn’t act independently, what purpose would they serve?

Something to consider: if you have three sticks glued together, you’d want the parent (container) rigidbody to handle gravity and other physical interactions, but if one of the broke free of the glue, you’d probably want to activate a rigidbody on the stick so it acts independently of the system.

Obviously, it’d be wise to also unparent the broken-off stick, but you wouldn’t have to - and you could also still simply call Destroy on the parent GameObject to remove the whole thing.

2 Likes

Your first statement makes sense.

Cheers.

I got it fixed as I made freeze position constraints checked.