- Home /
Rigid Body Won't MovePosition when parenting
I'm trying to take the physics object gun, change it to kinematic, move it immediately to wepspace, and then make it a child of wepspace.
My problem: gun does not move to wepspace, though it becomes kinematic and a child of it.
gun.rigidbody.MovePosition(wepspace.transform.position);
gun.rigidbody.isKinematic = true;
gun.transform.parent=wepspace.transform;
Answer by Teh_Bucket · Aug 10, 2013 at 12:36 AM
It turns out MovePosition is not what I need, setting the transform.position works fine.
whichgun.transform.position = wepspacething.transform.position;
Do note though that moving your rigidbody with transform.position is much more expensive than using rigidbody.position/rigidbody.$$anonymous$$ovePosition(). With that said, using the latter two options won't drag your child rigidbody around, like you mentioned.
Your answer
![](https://koobas.hobune.stream/wayback/20220613111826im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Make a simple tree 1 Answer
Best way to destroy a large object into smaller fragments? 2 Answers
Connecting Multiple Rigidbodies with Collision 0 Answers
find ALL children of a parent 1 Answer
Making child/parent movement smooth instead of choppy 1 Answer