x


" You should never have a parent and child rigidbody together " ?

I found this tip in http://unity3d.com/support/documentation/Manual/Physics.html But I would like to know why? What sort of problems can this create?

more ▼

asked May 04 '11 at 09:59 AM

Aldwoni gravatar image

Aldwoni
865 27 30 34

(comments are locked)
10|3000 characters needed characters left

1 answer: sort oldest

A rigidbody component controls the GameObject it's attached to. The velocity get's calculated in worldspace. If you parent a rigidbody to another, the child will get additional "forces" (actually the gameobject will move along with the parent, so no real forces) that will make the child do crazy things. A rigidbody represents one single physic object. Parent-child relationship doesn't work here. If you want two rigidbodies to be bound together, use joints.

more ▼

answered May 04 '11 at 11:55 AM

Bunny83 gravatar image

Bunny83
45.1k 11 48 206

Which joint does the same as Parent-Child? I want want an object to have the same movement as another object.

May 04 '11 at 12:27 PM Aldwoni

Are you sure that you need the secondobject to be a seperate rigidbody? If you parent an object (without a rigidbody) to another it will be part of the rigidbody of the parent. Anyway the FixedJoint is what you want: http://unity3d.com/support/documentation/Components/class-FixedJoint.html

May 04 '11 at 12:54 PM Bunny83

I have 3 objects. Object A is the movable object for the player. Object B has a Fixed Joint with Object A. Object C is an item the player has to pick up. When you pick Object C, it becomes a child of Object B. I now kill the rigidbody of Object C before make it Child of Object B. But now, Object C scales and rotates when it is pick up or dropped down. Do you know a solution?

May 04 '11 at 01:50 PM Aldwoni
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1865
x1783
x418
x407
x135

asked: May 04 '11 at 09:59 AM

Seen: 2566 times

Last Updated: May 04 '11 at 09:59 AM