Search Unity

Children collisions

Discussion in 'Physics' started by Compressed, Feb 18, 2015.

  1. Compressed

    Compressed

    Joined:
    Sep 20, 2014
    Posts:
    59
    I have a parent object which has a non-kinematic rigidbody on it. This parent object has several children objects in it and all of them have a collider on them.
    So if something collides with any of the children's colliders, it will push the parent rigidbody (so basically if i took the colliders from the children and placed them directly on the parent object it would made no difference). This is the way i want it.
    The problem is, i need the children objects to have their own kinematic rigidbodies. But when i add rigidbodies to the children, their colliders stop working and no longer affect the parent's rigidbody in any way (they just pass through everything).
    So how can i force the children colliders to affect the parent rigidbody even though the children have kinematic rigidbodies on them?
    thanks
     
  2. sami1592

    sami1592

    Joined:
    Sep 18, 2013
    Posts:
    57
    for this part only, i can help. You can use joints as opposed to parent-child relationship. look into it, may be it will come off as a solution
     
  3. Compressed

    Compressed

    Joined:
    Sep 20, 2014
    Posts:
    59
    It's for a rigged character so i can't attach the children as nonparented objects via joints.

    To be more specific, i have a character with ragdoll parts generated, (so for example a leg has a charcter joint, rigidbody and a capsule collider on it, standard unity ragdoll).. when the character dies i just disable the animator and turn all rigidbodies on all body parts into non-kinematic, and boom the character is a ragdoll now.
    While the character is alive those rigidbodies are set to kinematic. The problem is, when he runs around he can push objects with even huge mass settings very easily (because the collider on the limb he uses to push objects is connected to a kinematic rigidbody in that limb, instead of the main rigidbody in the root object). I can easily solve this problem by deleting the character joint and the rigidbody from all body parts and the collider then works the way i want it: it's connected to the rigidbody in the root object. But that does me no good, since when i do that, i don't have a functional ragdoll anymore.

    The only solution i can think of is to generate ragdoll into the model on death (as in add the character joints, rigidbodies etc to all the body parts with a script, only in the moment when i need to turn the character into a ragdoll) but this seems like pretty bad and costly solution.
     
  4. sami1592

    sami1592

    Joined:
    Sep 18, 2013
    Posts:
    57
    i have seen the solution used in a digital tutors
     
  5. Compressed

    Compressed

    Joined:
    Sep 20, 2014
    Posts:
    59
    Can you provide a link?
     
    sami1592 likes this.
  6. sami1592

    sami1592

    Joined:
    Sep 18, 2013
    Posts:
    57
    LINK
    i believe the desired tutorilals are no 19, 20 and 21.
     
  7. Compressed

    Compressed

    Joined:
    Sep 20, 2014
    Posts:
    59
    Well those are paid videos so that is no good unfortunately.