Search Unity

more than 1 kinematic object make jointed system defective?

Discussion in 'Scripting' started by vagos21, Jan 17, 2013.

  1. vagos21

    vagos21

    Joined:
    Sep 3, 2012
    Posts:
    18
    Hello,

    i'm really near the completion of my little software, which dynamically loads and creates rigidbodies with configurable joints etc. Let's say i create a chain of rigidbodies and want to hold the 2 ends of it and move them around. so i make these ends kinematic. according to this:

    http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody-isKinematic.html

    "Kinematic bodies also affect the motion of other rigidbodies through collisions or joints"

    so what i'm trying to do should really work but the problem is here in this video

    http://www.youtube.com/watch?v=r2l8Lhzvrxw

    this is the "parts" (lego style with somewhat elastic joints) connected together. every part has a connector to which it's tied using a configurable joint with everything Locked to make it as stiff as possible (working fine) every piece is connected to each other with also an all locked configurable joint allowing for a 3degree rotation slack (also working fine)

    the problem comes when i try to move one connector to the other to create a closed shape. if i have one connector set to kinematic (to keep the whole structure steady) i can move the other one and the whole structure moves at it should. BUT if i turn on isKinematic to the second connector too and try to move it around... it doesn't affect the rest of the chain as it should anymore!

    my goal is to move the first connector to exactly the position of the second, to create a joint between them like i do with the rest of the structure.

    Any ideas why this doesn't work? or how i can precisely move one connector rigidbody to the other with a mouseclick? (cannot just use fixedUpdate for movePosition as it just happens when the user clicks from one connector to the other)

    thank you!
     
  2. wccrawford

    wccrawford

    Joined:
    Sep 30, 2011
    Posts:
    2,039
    From that same documentation page:

     
  3. vagos21

    vagos21

    Joined:
    Sep 3, 2012
    Posts:
    18
    well that's how it should be, they will not affect the kinematic rigidbody, it's supposed to be static after all. but the kinematic rigidbody isn't supposed to affect the rest non-kinematic rigidbodies through the joint? or do i get a side-effect that half of the joint works or something like that...?